Remove Extra Spaces, Including the Ones You Cannot See
More than one character looks like a space. The full-width space that fills Korean and Japanese documents is a different character from the one your spacebar types, so find-and-replace in Word never catches it — and nothing on screen explains why.
If you have ever pasted text, seen odd gaps in it, and been unable to delete them however hard you tried, the gaps were probably not spaces. Unicode contains a family of characters that render as blank width, and on screen they are indistinguishable from one another.
This tool converts those characters to ordinary spaces before it tidies anything, so you can paste and get a clean result without knowing which variety you were dealing with.
The two that catch people out
The ideographic space U+3000 is what Korean and Japanese input methods produce. Documents written in Hangul — especially anything from HWP, the standard Korean office suite — are full of them, used for paragraph indents and for lining up columns by eye. It is as wide as one Hangul syllable, so it looks like a slightly generous gap and nothing more.
The non-breaking space U+00A0 arrives with anything copied from a web page or from Word. Its actual job is to prevent a line break at that point, so leaving it in place means text later wraps in the wrong position. It is the character behind HTML's .
Neither is found by typing a space into a find-and-replace box, in Word or anywhere else. The character you typed and the character in the document are simply not the same.
Characters that look like a space
All render as blank width and all are distinct characters. This tool handles every row below.
| Code point | Name | Where it comes from | What happens to it |
|---|---|---|---|
| U+0020 | Space | The spacebar | Runs collapsed |
| U+00A0 | Non-breaking space | Web pages, Word | Converted to a space |
| U+3000 | Ideographic space | Korean/Japanese input, HWP | Converted to a space |
| U+2000–200A | Typographic spaces | PDFs, typesetting software | Converted to a space |
| U+200B | Zero-width space | Web line-break hints, copying | Deleted |
| U+FEFF | Byte order mark | File encoding, start of CSVs | Deleted |
Zero-width characters are deleted, emoji are left alone
The zero-width space U+200B and the byte order mark U+FEFF occupy no width at all. Converting them to ordinary spaces would insert a gap that was never in the text, so they are removed rather than folded.
Not every zero-width character is removed, though. The zero-width joiner U+200D stays. It is not stray whitespace but the glue that binds emoji together — a family emoji is several person emoji joined by it — and deleting it would split one emoji into three separate people.
If the first column of a CSV keeps failing to match its header, suspect U+FEFF. Excel routinely writes one at the start of the file, where it is completely invisible and quietly breaks the first field name.
Before you strip trailing spaces
Removing trailing spaces is normally right. They add nothing, inflate file size, and make version control report changes where the text did not actually change.
There is one exception worth knowing. In Markdown, two spaces at the end of a line mean a line break. Running this tool over Markdown source with trailing-space removal on will silently collapse those breaks and run your lines together. Turn that option off when the text is Markdown.
"Remove all spaces" will glue words together if you point it at prose, so keep it for values that were never supposed to contain spaces — reference numbers, codes, identifiers.
Good uses for this
- •Cleaning indent and alignment spacing out of text copied from HWP or Word.
- •Stripping non-breaking spaces from text scraped off a web page.
- •Fixing the ragged gaps you get when copying a sentence out of a PDF.
- •Trimming stray whitespace and byte order marks from a CSV exported by Excel.
- •Normalising a list that several people contributed to before merging it.
Extended FAQ
Find-and-replace in Word does not remove these spaces. Why?
Because what you typed into the search box was an ordinary space, U+0020, and what is in the document is probably an ideographic space U+3000 or a non-breaking space U+00A0. They are different characters and will never match. Pasting the text here fixes it without you needing to identify which one it was.
Where does the full-width space come from?
Pressing space while a Korean or Japanese input method is active can produce a space sized to match one CJK character. It is also used deliberately to align text in documents. Either way it looks wrong once the text moves to the web, so it is usually worth normalising.
Will this break my emoji?
No. The joiner that holds compound emoji together is deliberately preserved. Removing every zero-width character would scatter things like the family emoji into their individual components, so the set of characters being stripped is kept narrow enough to avoid that.
Does it handle line breaks too?
This tool works on spacing within lines. To remove the line breaks themselves or clear out blank lines, use the line break remover.
Is my text sent anywhere?
No. Everything runs in your browser and nothing is transmitted.
