Extra whitespace is the quiet defect behind a surprising number of problems: a search that fails because a value has a trailing space, a CSV column that will not match, a paragraph that looks ragged after a paste, a word count that is inflated by double spacing. None of it is visible, and all of it is annoying. This tool removes extra spaces from text in one click — collapse repeats, trim every line, strip all whitespace or flatten line breaks.
Where stray spaces come from before you remove extra spaces
PDFs and printed documents use spacing to justify text, so copying a paragraph often yields irregular gaps between words and hard line breaks at the edge of every column.
Word processors carry non-breaking spaces, tab stops and multiple spaces typed by hand — the classic “space after a full stop” habit produces double spacing throughout.
Web pages collapse whitespace visually but keep it in the source, so a copy from a rendered page can include indentation and newlines that never appeared on screen.
Spreadsheets and exports frequently pad values to a fixed width, leaving trailing spaces that break exact matches.
The three modes for removing extra spaces
Collapse is the default because it fixes the common case without destroying deliberate structure — your paragraphs and single spaces survive, and only the noise goes.
Why trimming matters when you remove extra spaces from data
In any exact-match context — a database lookup, a VLOOKUP, a de-duplication pass, a form validation — a leading or trailing space makes two otherwise identical strings different. Trimming whitespace before comparison is one of the first things a data-cleaning script does, and doing it here by hand is the quick equivalent for a list you are about to paste somewhere that will not forgive the extra characters.
A worked example, with the counters
Take three words out of a justified PDF, where the gaps have been stretched to fill the column: The quarterly report — two spaces after the first word, three after the second. Twenty-three characters, five of them whitespace.
Collapse extra returns The quarterly report: twenty characters, two of them whitespace, three cut. That is exactly what the four readouts show — Characters 20 (from 23), Whitespace left 2, Removed 3, Mode Collapse extra. Remove all would hand back Thequarterlyreport instead: eighteen characters, no whitespace at all, five cut.
The counters exist because whitespace damage is invisible. A paste that looks clean can still carry a trailing space on every line, and comparing the before and after numbers is the only honest way to know.
Invisible spaces that never came from the space bar
Unicode has more than a dozen characters that render as a gap. Web pages are full of (U+00A0), which stops a line breaking in an awkward place. Typesetters reach for the thin space (U+2009) and the en and em spaces (U+2002 and U+2003) to fine-tune spacing. CJK text uses the ideographic space (U+3000), which is as wide as a character.
None of these match the [ ] pattern a naive clean-up uses, which is why they so often survive a trim and then break an exact match later: two strings that look identical on screen, one holding U+00A0 and the other U+0020, are different strings to a database and to a diff. All of them are rewritten as plain spaces here before the collapse runs, so what comes out is genuinely ASCII-spaced rather than merely tidy-looking.
When to use each extra spaces removal mode
A few scenarios: Collapse extra for general prose cleanup after a PDF paste; Remove all when building hashtags, tokens or keys that cannot contain any whitespace; Flatten lines to undo the column breaks that PDFs insert mid-paragraph. Each mode runs entirely in the browser, so contracts, transcripts and confidential documents are cleaned with no upload and no server round trip.