Remove Extra Spaces & Whitespace
Writing ToolsClean pasted text: collapse double spaces, trim lines, and remove hidden non-breaking and zero-width spaces.
Processed in your browser. A copy of each run is saved to your past runs so you can reopen it. Privacy
About
What the Remove Extra Spaces does
Remove Extra Spaces cleans the whitespace in pasted text as you type. It collapses runs of spaces into one, trims spaces at the start and end of each line, turns tabs into spaces and removes blank lines. It also finds the invisible characters that make copied text misbehave, non-breaking spaces and zero-width spaces, and says how many it removed.
Steps
How to use it
- 1Paste the text.
- 2Choose what to clean; the defaults suit most pasted text.
- 3Copy the result and check the status line for hidden characters found.
Example
A real run
Input
" Blue Widget\t Large\u200b \u00a0"
Output
"Blue Widget Large" Removed 8 characters · 1 non-breaking space and 1 zero-width character found · 1 tab
The input is written with escapes so the hidden characters are visible: a tab, a zero-width space (\u200b) and a non-breaking space (\u00a0). All three, the double space and the surrounding spaces are removed.
Options
Every setting, and when to use it
- Collapse repeated spaces and Trim each line
- Turns "Blue Widget" into "Blue Widget" and removes spaces before and after each line. Line breaks are kept, so lists and paragraphs keep their shape.
- Remove non-breaking and zero-width spaces
- Non-breaking spaces (U+00A0) look like normal spaces but break searches and formulas; zero-width spaces (U+200B) and byte-order marks (U+FEFF) are invisible. This turns the first into normal spaces and deletes the others.
- Tabs to spaces, Remove blank lines and Remove all spaces
- Tabs become single spaces; blank lines are dropped; Remove all spaces deletes every space and tab, for codes such as "AB 12 CD" that must be "AB12CD".
Good to know
Common problems and limits
Up to 10 MB. Line breaks are never removed by these options; to join lines, use Remove Line Breaks.
Only whitespace is changed; letters, punctuation and other invisible characters such as right-to-left marks are left as they are.
To replace a specific word or pattern instead, use Find and Replace.
Audience
Who uses it
- Spreadsheet usersFix values that look identical but do not match in VLOOKUP or a pivot table because of hidden spaces.
- Content editorsClean text pasted from Word, PDFs or websites before it goes into a CMS or an email template.
- DevelopersStrip zero-width characters and byte-order marks that break JSON keys, CSV headers or string comparisons.
FAQ
Frequently asked
Why does copied text have phantom spaces?
Web pages and word processors use non-breaking spaces (U+00A0) to keep words together, and some sites insert zero-width spaces (U+200B) to allow line breaks in long words. Both survive copy and paste, look like nothing or like a normal space, and make text fail to match. This page removes them and counts how many it found.
How do I remove extra spaces in Excel?
=TRIM(A1) removes extra spaces between words and at the ends, but not non-breaking spaces. For text from the web use =TRIM(SUBSTITUTE(A1, CHAR(160), " ")), which turns non-breaking spaces into normal ones first.
How do I remove double spaces in Word?
Open Find and Replace (Ctrl+H), type two spaces in Find and one space in Replace, and press Replace All until Word finds none. With wildcards on, "( ){2,}" replaced with "\1" does it in one pass.
How do I remove whitespace in Python?
s.strip() removes it from both ends; " ".join(s.split()) collapses every run of whitespace, including tabs and line breaks, into single spaces. Python's split() also treats non-breaking spaces as whitespace, but not zero-width spaces.
Will this remove my line breaks?
No. Every option works within lines; only Remove blank lines deletes empty lines. To join lines into paragraphs, use Remove Line Breaks.
Is my text sent anywhere?
No. Cleaning happens in your browser. A copy of each run is saved to your past runs so you can reopen it.
Automation: an MCP tool clean_whitespace(text, options) → text and an n8n node are planned for this tool.