Extra Space Remover
Paste text with messy spacing and tick the clean-up steps you want: collapse runs of spaces and tabs, trim the start and end of every line, delete blank lines or reduce several to one, or join all the lines into a single paragraph. You see the characters before, after and removed. Free, no sign-up, and nothing is uploaded.
Cleanup options
How to Use the Extra Space Remover
- Paste your text. Anything with ragged spacing: a pasted table, a web page, a document with double spaces after full stops.
- Tick the clean-up options. Collapse spaces and trim lines are on by default. The other three are off, because removing blank lines or line breaks changes the shape of your text.
- Press Clean Text. The result does not update as you type, so press the button again after you change an option. Three counts show characters before, after and removed.
- Copy the result. Use Copy Result, or Clear to start again.
What Each Option Does
The sample below has leading and trailing spaces, three spaces mid-line, a tab pair, and runs of blank lines. It is 77 characters long, and the figures are what the tool reports for it (\n marks a line break):
| Options ticked | Result | Removed |
|---|---|---|
| Defaults (collapse + trim) | Chapter one begins here.\n\n\n\nIt was late. Very late.\n\nThe end. | 16 |
| + Remove blank lines | Chapter one begins here.\nIt was late. Very late.\nThe end. | 20 |
| + Collapse blank lines | Chapter one begins here.\n\nIt was late. Very late.\n\nThe end. | 18 |
| + Remove ALL line breaks | Chapter one begins here. It was late. Very late. The end. | 20 |
- Collapse multiple spaces/tabs to one replaces any run of two or more spaces or tabs, in any mix, with one space. A single tab on its own is left alone.
- Trim line starts and ends strips spaces and tabs from both ends of every line, so indentation goes too.
- Remove blank lines deletes every line that is empty or holds only spaces, so paragraphs run together. Tick Collapse instead if you want to keep one blank line between them.
- Collapse multiple blank lines to one reduces three or more line breaks in a row to a blank line and leaves a single blank line as it is.
- Remove ALL line breaks joins everything into one paragraph with a single space where each break was. This is the option for text copied from a PDF; the Remove Line Breaks tool gives you more control over paragraphs.
What It Cannot See
The tool treats only the ordinary space and the tab as whitespace. Text pasted from a web page or a word processor often contains no-break spaces (U+00A0), which look the same but are different characters; two of them in a row are left as they are. Run suspect text through the Hidden Character Detector to find and replace them, then clean it here. Windows and old Mac line endings are converted to plain line breaks before anything else happens.
One space or two after a full stop?
Typewriter habits left many writers typing two spaces after a period. APA 7 recommends one space after the period at the end of a sentence, and most editors now expect one. Ticking Collapse spaces fixes a whole document at once, but it also collapses any intentional runs of spaces, such as aligned columns.
Which Tool Do You Need?
| If you want… | Use |
|---|---|
| Spaces, tabs and blank lines cleaned | This Extra Space Remover |
| Wrapped PDF or email lines rejoined into paragraphs | Remove Line Breaks |
| Lines broken after sentences, words or a separator | Add Line Breaks |
| Lines containing a word deleted | Line Filter |
| Invisible and special space characters found | Hidden Character Detector |
| A specific string replaced | Find and Replace |
Frequently Asked Questions
- How do I remove extra spaces from text?
- Paste the text, leave Collapse multiple spaces/tabs to one ticked and press Clean Text. Every run of two or more spaces or tabs becomes one space. Also tick Trim line starts and ends if the lines have spaces at their edges.
- What is the difference between removing and collapsing blank lines?
- Removing deletes every empty line, so the text sits line under line with no gaps. Collapsing keeps paragraph separation but reduces any run of blank lines to a single one. If you tick both, removal runs first and nothing is left to collapse.
- Does it remove tabs as well as spaces?
- Yes, in a run. Two or more spaces or tabs in a row, in any combination, become one space, and trimming strips both from the ends of lines. A lone tab in the middle of a line is kept, because the option looks for runs of two or more.
- Why are some double spaces still there?
- Probably because they are not ordinary spaces. Text from web pages and word processors can contain no-break spaces and other special spaces, which this tool does not treat as whitespace. Find them with the Hidden Character Detector first.
- How do I remove all line breaks?
- Tick Remove ALL line breaks (one paragraph). Each break, with any spaces around it, is replaced by one space and the result is trimmed. To keep paragraph breaks and remove only the ones inside paragraphs, use the Remove Line Breaks tool instead.
- Is my text uploaded or stored?
- No. The cleaning runs in your browser and nothing is sent to a server. Closing the tab clears the text.