Paste messy text into the box and this tool removes extra spaces as you type: double spaces become single, tabs are collapsed, spaces at the start and end of each line are trimmed, and you choose whether to keep paragraphs or remove blank lines entirely. If you just want to remove double spaces from an essay or email, paste it and copy the cleaned version. The default keeps your paragraphs, so the text still reads like you wrote it. The tool also tells you how many characters it removed, which is a nice way to see how much junk was hiding in there.
Remove extra spaces from a PDF notice: before and after
Here's the kind of text that comes out of a college notice PDF or a forwarded email. The second line starts with a tab, there are four empty lines in the middle and trailing spaces at the end:
Exam schedule for Monday Reach by 9:30 am. Bring your admit card.
With "collapse multiple spaces and tabs" and "trim spaces at start/end of each line" ticked, and blank lines set to keep paragraphs, you get:
Exam schedule for Monday Reach by 9:30 am. Bring your admit card.
The four empty lines became one (that's what "max one empty line" means), so the paragraph break survives. The counter shows 18 characters removed. Switch blank lines to remove all empty lines and the gap disappears completely, or pick join everything into one line to get Exam schedule for Monday Reach by 9:30 am. Bring your admit card.
Where all these extra spaces come from
Nobody types four spaces between words on purpose. They sneak in from other places:
- PDFs. A PDF stores text by position on the page, not as flowing sentences. When you copy it, you get a line break at the end of every printed line, extra spaces where text was justified, and sometimes tabs from tables.
- Word and Google Docs. Old habits like two spaces after a full stop, indents made with the spacebar, and non-breaking spaces that Word inserts in some places.
- WhatsApp Web and chat exports. Copying several messages pulls in extra line breaks and spaces around names and times.
- Websites. Copying from a web page often brings non-breaking spaces and hidden characters from the page's code.
The space that isn't a normal space (U+00A0)
This one causes the most confusing problems. A non-breaking space looks exactly like a normal space on screen, but it's a different character, code U+00A0. Websites and Word use it to stop two words from being split across lines, like "Rs. 500" or "10 km".
Why it matters:
- Excel and Google Sheets. A cell that looks like
500but has a non-breaking space in it is treated as text, so SUM ignores it. Excel's TRIM function removes normal spaces but not this one, which is why "I already used TRIM" often doesn't fix it. - Code. Paste a code snippet from a blog into your editor, and a hidden U+00A0 can give you a syntax error on a line that looks perfect. Python, for example, complains about an invalid non-printable character.
- Search and find-replace. In many editors, searching for "Rs. 500" with a normal space won't match "Rs. 500" written with a non-breaking one.
Tick convert non-breaking spaces to normal spaces and they all become ordinary spaces that every program understands.
Invisible characters you can't see at all
Zero-width characters take up no space whatsoever. The common ones are the zero-width space (U+200B), zero-width joiner and non-joiner, and the byte order mark (U+FEFF) that some files carry at the start. They get into text from websites, some keyboards and copy-paste between apps.
You'll sometimes notice them when a word count is off by one, when a password or coupon code you pasted is "wrong" even though it looks right, or when two identical-looking lines refuse to match. The remove zero-width/invisible characters option strips them out. If you're curious what these characters are and how people use them on purpose, the invisible text generator page goes into that side.
When to join lines into one
"Join everything into one line" sounds drastic, but it's the fix for one very common problem: text from a PDF that breaks mid-sentence.
The committee has decided that all students must submit the form by Friday evening.
Joined, that becomes one clean sentence you can paste into a form, a chat or a translation tool without random breaks. It's also handy for single-line fields like a YouTube description line, a spreadsheet cell or a search box.
The catch is that it joins everything, including real paragraph breaks. For a long PDF with several paragraphs, do it paragraph by paragraph, or use "keep paragraphs" and fix the few broken lines by hand.
Honest limits
- It cleans spacing, not words. Spelling, grammar and repeated words stay as they are. For repeated whole lines in a list, use the duplicate line remover.
- Code and poetry. Indentation matters in Python, YAML and some poems. Collapsing and trimming spaces will flatten it, so untick those options for that kind of text.
- Combined emojis and some scripts. A few emojis (like family or profession emojis) and some Indian-language spellings use a zero-width joiner on purpose. If a combined emoji splits into separate pieces after cleaning, untick the invisible-character option.
- It can't guess sentence breaks. When lines are joined, it doesn't add missing full stops. If the source had none, the result won't either.
- Tables. Text copied from a table relies on tabs to keep columns apart. Collapsing them merges the columns, so keep the original if you need it in a spreadsheet.
A whitespace remover that pairs well with other clean-up
Messy text usually has more than one problem. A sensible order: remove extra spaces and blank lines here first, then fix capitals with the case converter if the source was in all caps, then check length with the word counter. Doing spacing first means your word and character counts are accurate, because those stray spaces and invisible characters no longer get counted.
Everything runs in your browser, so pasting a private email or an exam notice here doesn't send it anywhere.