Whitespace Cleaner
Strip double spaces, trailing spaces and stacked blank lines in one pass.
Free, no signup, no limits
Pasted from a slide deck, with the indent still on it. Double spaces after a justified line. A non-breaking space, and a trailing one you cannot see Tabs from a spreadsheet. Three blank lines above this one. A real paragraph break, which stays.
How to remove extra spaces from text
Paste it on the left. The cleaned version appears on the right as you type, and the panel says what each pass caught.
Four things happen, always, in this order: odd spaces become ordinary ones, lines are trimmed at both ends, runs of spaces collapse to one, and stacked blank lines collapse to a single paragraph break.
Why trailing spaces survive other cleaners
Because the character at the end of the line is often not a space.
A non-breaking space renders identically to an ordinary one and is a different
character underneath. A trim that looks for [ \t] walks straight past it, so
the line still ends in whitespace, still fails an exact match, and still looks
perfectly trimmed to you.
That is why this tool normalises the odd spaces first. Every pass after it can then see what it is dealing with. Get that order backwards and the rest of the work is done on text you have not actually cleaned, which is exactly how a line with an invisible tail survives three different tools.
Where the mess comes from
Justified text. A PDF or a slide deck pads between words to make each line reach the margin, and the padding comes with you when you copy.
Word processors. Word and Google Docs insert non-breaking spaces around punctuation as you type, and neither shows you.
Spreadsheets. Copying cells gives you tabs, which look like indentation and are a different character.
Typewriter habits. Two spaces after a full stop, still muscle memory for a lot of people, and visible as a gap once the text is justified on a page.
What is deliberately left alone
Single line breaks. Collapsing them is a different job, and doing it here would mean this tool could not be run safely on anything with structure. If your text was shredded into one line per row by a PDF, run the line break remover first, then come back here.
Indentation is not preserved either, because a leading run of spaces is trimmed like any other. That is right for prose and wrong for code, so do not paste a source file through here.
What else is hiding in there
Whitespace is rarely the only thing that came along. The same paste usually carries zero-width characters, curly quotes and em dashes, none of which this tool touches.
The AI text cleaner handles those in one pass. Between the two, text pasted from almost anywhere comes out as plain, portable characters.
Everything runs in your browser. Nothing is uploaded.
Frequently asked questions
More Text tools
Everything else in the Text toolbox.
Something missing here?
If this tool almost does what you need, say what is missing. That is usually how the next version gets built.