Normalize Whitespace
Make all the whitespace in a text consistent: one kind of space, one kind of line break, no invisible characters.
Your text stays in this browser tab. Nothing is uploaded, saved or logged.
How the Normalize Whitespace works
Unicode has more than a dozen space characters: the non-breaking space, the thin space, the ideographic space used in CJK text, tabs and others. They look alike but do not match a normal space in searches, comparisons or code. This tool converts them all to a regular space.
Line endings (Windows CRLF, old Mac CR, and the Unicode line and paragraph separators) are converted to a single standard line break. Invisible characters such as the zero-width space, word joiner, soft hyphen and byte-order mark are removed. Zero-width joiners and non-joiners are kept because emoji and several scripts depend on them.
Each step is optional: collapse repeated spaces, trim each line, limit blank lines to one in a row and trim the whole text. Turn off tab conversion if you are working with tab-separated data.
How to use it
- Paste your text.
- Leave the steps you need switched on.
- Copy the normalised text.
Example
Special spaces, hidden characters and extra blank lines are all normalised.
Input
Hello world Second line with em space
Result
Hello world Second line with em space
Frequently asked questions
What is the difference from Remove Extra Spaces?
Remove Extra Spaces only collapses repeated ordinary spacing. Normalize Whitespace also converts special space characters, removes invisible ones and fixes line endings.
Will it break tab-separated data?
Yes, if tab conversion is on, since tabs become spaces. Switch that option off to keep tabs.
How can I find out what hidden characters my text contains?
Paste it into the Character Counter and compare the visible character count with the code point count. A big gap, or extra characters when nothing is visible, points to invisible characters.