Using the whitespace remover
Paste text and the extra space comes out as you type. By default runs of spaces shrink to one, each line is trimmed at both ends, tabs become spaces and paragraphs are kept apart by a single blank line.
Every setting has a stronger and a gentler choice. Spaces can be removed entirely, for a code or a number with gaps in it. A list usually wants Blank lines set to Remove them all. Trim each line can leave the start alone, which keeps indentation in code.
To join lines into one paragraph instead, use remove line breaks, which is a separate job with its own page.
The spaces you can't see
Text copied from a web page, a PDF or a chat app often carries spaces that aren't the ordinary space. The no-break space, U+00A0, looks the same but stops a line from wrapping, and a search for two words finds nothing when one of these sits between them. French text uses a narrower one, U+202F, before a question mark or an exclamation mark.
Some are invisible. The zero-width space, U+200B, takes up no room at all, and a soft hyphen, U+00AD, only shows up when a word breaks at a line end. They're why two strings that look identical fail to match.
This tool turns every kind of Unicode space into an ordinary one before it does anything else, and removes the zero-width ones outright. It also turns Windows and old Mac line endings into ordinary ones.
Related conversions
The text cleaner goes further with pasted text, straightening curly quotes and replacing em dashes. Remove line breaks handles the other shape of messy paste, a paragraph broken into short lines.
Questions
How do I remove extra spaces from text?
Paste it on the left. Runs of spaces become one space straight away, and each line is trimmed at both ends.
How do I remove all spaces?
Set Spaces to Remove them all. Every space goes, including no-break and zero-width ones, while line breaks stay.
How do I remove blank lines?
Set Blank lines to Remove them all. The default keeps one blank line between paragraphs, which is usually what a pasted document needs.
Will it keep my code's indentation?
Set Trim each line to End only (keep indents). Spaces at the start of each line are kept; trailing spaces and runs of spaces inside the line are still tidied.






