How to remove extra spaces
- Paste your text into the Your text box.
- The most common fixes are already on: double spaces, spaces at the start and end of lines, tabs and invisible spaces.
- Tick Remove empty lines, Remove spaces before punctuation or Remove all spaces if you need them.
- Click Copy result and paste the clean text where you need it.
What each option does
- Turn double spaces into one:
Hello····worldbecomesHello world. The most common problem in copied text. - Remove spaces at the start and end of lines: removes the indents and trailing spaces you can't see but that break alignment and forms.
- Turn tabs into spaces: text from spreadsheets and code often uses tabs. They become normal spaces.
- Fix invisible spaces: Word, Excel and websites often use non-breaking spaces that look normal but aren't. They stop formulas, searches and form checks from working. This option turns them into real spaces and deletes zero-width spaces.
- Remove empty lines: deletes blank lines, so every line has text on it.
- Remove spaces before punctuation:
Hello , world !becomesHello, world!, and( note )becomes(note). - Remove all spaces: for codes, phone numbers and IDs:
AB 12 34becomesAB1234. Line breaks are kept.
Examples
In this table, · stands for one space so you can see them.
| Before | Option | After |
|---|---|---|
Hello····world | Double spaces into one | Hello world |
···Total:·42··· | Trim line starts and ends | Total: 42 |
Hello·,·world·! | Spaces before punctuation | Hello, world! |
+44·20·7946·0958 | Remove all spaces | +442079460958 |
Remove extra spaces in Word, Excel and Google Docs
- Excel and Google Sheets:
=TRIM(A1)removes extra spaces, but Excel's TRIM does not remove non-breaking spaces. Use=TRIM(SUBSTITUTE(A1,CHAR(160)," "))in Excel, or paste the column here. - Word: press Ctrl + H, tick Use wildcards, type
( ){2,}in Find and\1in Replace, then click Replace All. - Google Docs: open Edit → Find and replace, tick Match using regular expressions, type
{2,}in Find and a single space in Replace.
More text clean-up tools
Text from a PDF with broken lines? Remove line breaks first. Need to swap words or symbols? Use Find & Replace. Check the final length with the word counter, or fix capitals with the case converter.
Frequently asked questions
Why doesn't Excel's TRIM remove all spaces?
Because some of them aren't normal spaces. Text copied from websites and Word often contains non-breaking spaces (character 160), which TRIM ignores. Turn on Fix invisible spaces here, or use SUBSTITUTE(A1,CHAR(160)," ") before TRIM.
What is a non-breaking space?
A special space that stops two words from being split across lines, such as in “10 km”. It looks like a normal space but computers treat it differently, which is why searches and formulas sometimes fail on copied text.
Does this remove line breaks too?
No. Line breaks are kept, so your paragraphs stay as they are. Only Remove empty lines deletes blank lines. To join broken lines from a PDF, use Remove Line Breaks.
Is my text uploaded?
No. Everything runs in your browser on your own device. Your text is never sent anywhere or saved.