What the Whitespace Cleaner does
The Whitespace Cleaner tidies text that has picked up messy spacing, which often happens when you copy from a PDF, a web page or a chat app. It trims the ends of lines, collapses repeated spaces into one, turns tabs into spaces, replaces invisible and non-breaking spaces, and controls blank lines between paragraphs.
How to use it
- Paste the messy text into the Input box.
- Tick the clean-ups you want: trim each line, collapse repeated spaces, tabs to spaces, and fix invisible spaces.
- Choose what happens to blank lines: keep them, allow at most one in a row, or remove them all.
- Copy or download the cleaned text. The status line shows how many characters were removed.
Example
Copying a paragraph out of a PDF gives text with double spaces after every full stop, four blank lines between paragraphs and a hidden zero-width space that breaks a search. With the default settings the tool collapses the spaces, leaves a single blank line between paragraphs and removes the hidden character, so the text pastes cleanly into your document.
What are invisible spaces?
Some characters look like nothing but still sit in the text: zero-width spaces, word joiners and byte order marks. They can stop a search from matching, break a password or make two identical-looking words compare as different. Non-breaking spaces look like normal spaces but stop text wrapping. “Fix invisible and non-breaking spaces” removes the first kind and turns the second into ordinary spaces.
Questions people ask
Will it join my paragraphs together?
No. Lines stay separate. Choose “At most one blank line” to keep paragraphs apart while removing extra gaps.
Does it change indentation in code?
Trimming lines and converting tabs would change indentation, so turn those options off when cleaning code.
Can it remove line breaks completely?
Not this tool. Remove Line Breaks joins lines into one paragraph.
Is my text uploaded?
No. The cleaning runs in your browser.