How to use the Remove Extra Spaces
- Paste your text into the left box.
- Leave the recommended options on, or untick any you want to keep, such as tabs in spreadsheet data.
- Choose how to handle blank lines: keep them, allow at most one in a row, or remove them all.
- Check the counts to see exactly what was cleaned, then copy or download the result.
Features
- Collapses double and triple spaces into single spaces
- Trims spaces and tabs from the start and end of every line
- Replaces non-breaking, thin and other unusual spaces with normal ones
- Removes zero-width spaces, byte order marks and soft hyphens
- Keeps characters that emoji and some languages need, such as zero-width joiners
- Reports how many of each problem it fixed
Where extra whitespace comes from
Text rarely arrives clean. PDFs add spaces to justify lines, web pages use non-breaking spaces to stop words wrapping, older typing habits put two spaces after every full stop, spreadsheets pad cells with trailing spaces, and copying from chat apps or code editors brings tabs along. Most of these are harmless on screen but cause real problems later: a search for “New York” misses “New York”, a spreadsheet lookup fails because one cell ends with a space, or a password pasted from an email will not work.
What each option removes
| Character | Code | Why it causes trouble |
|---|---|---|
| Repeated spaces | U+0020 | Uneven gaps, broken alignment, failed matching |
| Tab | U+0009 | Displays at different widths in every app |
| No-break space | U+00A0 | Looks like a space but fails searches and spreadsheet comparisons |
| Narrow no-break, thin and em spaces | U+202F, U+2009, U+2003… | Typographic spaces that confuse plain-text tools |
| Zero-width space | U+200B | Completely invisible; breaks URLs, code and logins |
| Byte order mark | U+FEFF | Hidden at the start of files; corrupts CSV headers |
| Soft hyphen | U+00AD | Invisible until a word wraps, then a stray hyphen appears |
Collapse repeated spaces only shrinks runs that follow text, so indentation at the start of a line is preserved when trimming is switched off. Trim removes spaces and tabs from both ends of every line. Remove spaces before punctuation fixes “Hello , world !” style typos; leave it off for French text, which puts a space before some punctuation marks on purpose.
What is deliberately left alone
Some invisible characters do important work. The zero-width joiner (U+200D) glues emoji together, so 👨👩👧 is one family rather than three separate people, and it also shapes letters in scripts such as Devanagari and Malayalam. The zero-width non-joiner (U+200C) controls letter joining in Persian and other languages. Direction marks keep Arabic, Hebrew and Urdu text displaying correctly. Removing any of these would damage text rather than clean it, so this tool keeps them.
One space or two after a full stop?
Two spaces after a sentence was a typewriter convention, when every letter had the same width. Modern style guides, including the Chicago Manual of Style and the seventh edition of the APA Publication Manual, recommend a single space. Collapsing repeated spaces converts old documents to that style automatically.
Tips for spreadsheets and data
- Excel’s TRIM function removes ordinary spaces but not non-breaking spaces (character 160), which is why some cells refuse to match. Cleaning the column here first fixes that.
- If your data is tab-separated, untick Turn tabs into spaces so the columns survive.
- After cleaning a list, remove repeated entries with Remove Duplicate Lines.
- For text broken into short lines, such as a PDF copy, use Remove Line Breaks next.
Frequently asked questions
The cleaned text looks the same. Did anything change?
Probably, if the counters are above zero. Non-breaking spaces and zero-width characters look identical to normal spaces or to nothing at all, which is exactly why they cause problems.
Will this break emoji or non-English text?
No. The zero-width joiner and non-joiner, which emoji and several writing systems depend on, are kept, along with direction marks for right-to-left languages.
What is a non-breaking space?
A space character (U+00A0) that stops a line from wrapping between two words. Web pages use it a lot, and it often comes along when you copy text from a browser.
Can I keep tabs in tab-separated data?
Yes. Untick “Turn tabs into spaces” and tabs are left exactly where they are. Repeated-space collapsing only affects normal spaces.
Is my text uploaded?
No. All cleaning happens in your browser and the text never leaves your device.