Paste messy text and get it back with single spaces, trimmed lines and no stray tabs, blank lines, non-breaking or invisible zero-width spaces. Switch to Show spaces to see exactly where the problems are.
0 characters
0 characters
Show spaces marks · extra spaces, → tabs, ° non-breaking or special spaces and | zero-width characters. Your text never leaves your browser.
Advertisement
Advertisement
How to use the Remove Extra Spaces
Paste your text into the left box. The cleaned version appears on the right straight away.
Check Show spaces to see double spaces, tabs, non-breaking and zero-width characters highlighted.
Choose the clean-up options: collapse spaces, trim lines, what to do with tabs and blank lines.
Read the summary to see how many spaces, tabs and lines were removed.
Copy or download the cleaned text.
Whitespace characters this tool handles
Character
Code point
Where it comes from
What happens
Space
U+0020
Normal typing
Runs of 2+ become 1; trimmed at line ends
Tab
U+0009
Spreadsheets, code, aligned text
Replaced with a space, removed or kept
Non-breaking space
U+00A0
Web pages ( ), Word, PDFs
Becomes a normal space
En, em, thin, hair spaces
U+2000–U+200A
Typeset documents, design apps
Becomes a normal space
Narrow no-break space
U+202F
French punctuation, number formatting
Becomes a normal space
Ideographic (full-width) space
U+3000
Chinese and Japanese text
Becomes a normal space
Zero-width space
U+200B
Web pages, chat apps
Removed
Byte order mark
U+FEFF
Start of some text files
Removed
Soft hyphen
U+00AD
Hyphenated web text, e-books
Removed
Why extra spaces cause problems
Double spaces look sloppy in published text, and hidden characters cause real bugs: a spreadsheet VLOOKUP fails because one cell ends with a space, a password copied from an email contains a zero-width space, or a list sorts wrongly because some lines start with a tab. Cleaning the text first makes it consistent. If you also want to join broken lines from a PDF into paragraphs, run the result through a line break remover.
Frequently asked questions
How do I remove double spaces from text?
Paste the text into the box. With Replace multiple spaces with one switched on, every run of two or more spaces becomes a single space. The result appears instantly on the right, ready to copy.
Will it remove my line breaks?
No. Line breaks and paragraphs are kept. Only blank lines are affected, and by default at most one blank line is kept between paragraphs. Choose Keep blank lines to leave them untouched, or use a line break remover to join lines.
What is a non-breaking space?
A non-breaking space (U+00A0, in HTML) looks like a normal space but stops a line break and is not matched by many search, sort or spreadsheet functions. Text copied from web pages, Word or PDFs often contains them. This tool turns them into normal spaces.
What are zero-width characters?
They are invisible characters such as the zero-width space (U+200B), word joiner (U+2060), byte order mark (U+FEFF) and soft hyphen (U+00AD). They can break searches, passwords and code. The tool removes them but keeps the zero-width joiner used inside emoji.
Can I keep indentation with tabs?
Yes. Set Tabs to Keep tabs. If you also want to keep spaces at the start of lines, untick Trim spaces at the start and end of each line.
Is my text uploaded?
No. All cleaning happens in your browser with JavaScript. Nothing is sent to a server or saved anywhere except, optionally, in your own browser for next time.