The spaces you cannot see
Text copied from a PDF or a web page often contains characters that look like a space and are not: non-breaking space (U+00A0), narrow no-break space, zero-width space, and the assorted en and em spaces typesetters use.
They break things quietly. A search for "New York" fails against a non-breaking space between the words. A CSV import treats the field as different from the identical-looking one beside it. A line refuses to wrap where it should. Those are converted to ordinary spaces here, which is usually the fix for a problem that had no visible cause.
What gets collapsed
Runs of spaces become one; trailing spaces at the end of lines go; leading indents can be kept or removed. Blank lines are left alone unless you ask, because in prose they are paragraph breaks rather than noise.
Double spaces after full stops are a typewriter habit that most style guides dropped decades ago — collapsing them is the common case rather than the exception.
Frequently asked questions
Why does my text still have odd spacing after cleaning?
It probably contains non-breaking or zero-width spaces, which look identical to a normal space and are different characters. Those are converted here too.
Will it remove my paragraph breaks?
No. Blank lines are kept by default, because in prose they separate paragraphs.
Why does search fail on text that clearly contains the word?
Usually a non-breaking space where you expect an ordinary one — common in text copied from PDFs and formatted web pages.
Something wrong with this tool, or an idea for it? Tell us