Loading the interactive tool… It runs in your browser — if it doesn't appear, enable JavaScript.
Collapse runs of spaces into one, trim the ends of every line, convert tabs, and tidy up stacked blank lines. The usual cleanup after text has passed through a few copy-pastes, a word processor, or a badly formatted export.
It also removes something you can't see: invisible Unicode spaces. Non-breaking spaces, en and em spaces, the ideographic space and zero-width characters all look identical to a normal space — or to nothing at all — but they break searches, CSV imports and string comparisons. They survive ordinary find-and-replace because you can't type what you're looking for.
Frequently asked questions
What are invisible Unicode spaces and why do they matter?
Characters like the non-breaking space (U+00A0), the em space (U+2003) and the zero-width space (U+200B) render identically to a normal space or to nothing at all, but they're different characters. Text copied from web pages, Word or design software is full of them, and they're the usual reason a lookup fails, a CSV column misaligns, or two apparently identical strings don't match.
What's the difference between collapsing and removing blank lines?
Collapsing reduces runs of three or more blank lines to a single blank line, preserving paragraph structure. Removing strips every blank line entirely, giving you a solid block. Use collapse for prose, remove for lists and data.
Does it affect indentation in code?
Yes — collapsing repeated spaces and trimming line ends will flatten indentation, so don't run source code through it with those options on. Turn off "collapse repeated spaces" and "trim line ends" if you only want the invisible-character cleanup.