Whitespace & Text Cleaner
Remove extra spaces between words, spaces at line ends and invisible characters from copied text. Choose whether to also remove indentation, empty lines, line breaks, tabs, control characters or direction marks.
Runs in your browser. Your data is not uploaded.How our tools work
Cleaning statistics
- Original length
- 0
- characters
- Cleaned length
- 0
- characters
- Characters removed
- 0
How do I remove extra spaces from text?
Paste your text and extra spaces are removed straight away: “Hello” and “world” with five spaces between them get one space, spaces at line ends go, and invisible characters from copied text are fixed. Your line breaks and paragraphs stay as they are unless you choose to remove indentation, empty lines or line breaks. See how many characters were removed.
- Paste or type your text, or select “Try an example” to see what it fixes in text with hidden characters.
- Check the options: the safe defaults remove extra spaces, trailing spaces and invisible characters. Turn on the others only if you need them.
Key features
Safe defaults
Extra spaces between words and at line ends are removed, while lines, paragraphs and indentation are kept.
Invisible characters fixed
Non-breaking spaces become normal spaces, and zero-width spaces and byte-order marks are removed. Joiners used in emoji and in Persian and Urdu are kept.
You choose the rest
Optionally remove indentation, collapse or remove empty lines, join everything into one paragraph, convert tabs to spaces at tab stops, remove control characters and soft hyphens, or remove direction marks.
Common uses
- Clean up text copied from a PDF, website or email
- Remove double spaces after full stops
Related tools
Frequently Asked Questions
Will it remove my line breaks?
Not by default. Line breaks and paragraphs are kept. Choose “Join all lines into one paragraph” only if you want them removed.
What are invisible characters?
Spaces you can’t see, such as non-breaking spaces and zero-width spaces, that come with copied text and can break searches, forms and code.
Are tabs removed?
Tabs inside a line are kept, because they often separate columns. Tabs at the start or end of a line are removed with the matching option. “Convert tabs to spaces” replaces each tab with spaces up to the next tab stop (2, 4 or 8 characters), so columns stay aligned.
What are control characters?
Invisible codes such as the bell, escape or delete characters that terminals, PDFs and older systems leave in text, plus soft hyphens. They can break forms and searches. Tabs and line breaks are never removed by this option.
Why are direction marks kept by default?
Marks such as RLM and LRM tell the browser how to order text that mixes right-to-left scripts, like Urdu, Arabic or Hebrew, with English or numbers. Removing them can change how the text displays, so only remove them when you know they aren’t needed.
Last updated: