Skip to the tool

Whitespace Cleaner

Extra whitespace is the double spaces, trailing spaces, tabs and repeated blank lines you cannot see but that still break how text looks when it moves between programs. This cleaner removes them from anything you paste and counts each kind it found, so you can see what was actually there.

What to tidy

Not sure what these mean? See all the words

Everything happens in your browser. Your text is never uploaded, stored or logged.

 

 

This tool only tidies spaces, tabs and line breaks. Some characters are invisible in a stronger way and take up no room at all — this tool leaves those alone, and it tells you if it finds any. The remover is the tool for them.

How to use it

  1. Paste your text in the left box. The tidied version appears on the right straight away.
  2. Look at the counters. Every step has its own number next to it, so you can see exactly what happened rather than taking it on trust.
  3. Press Copy tidied text. Paste it wherever you needed it.

Why the numbers matter. Everything this tool removes is made of spaces, so the result looks the same as what you pasted. The numbers are how you know it did something.

What it fixes

All of this is whitespace you could see if you selected the text. It is the mess that arrives with anything copied out of a document, a PDF or a web page.

  1. Double and triple spaces. Between words, squeezed down to one.
  2. Spaces on the ends of lines. Nothing shows you these, and they break code, spreadsheets and search.
  3. Walls of blank lines. Between paragraphs, collapsed to a single gap.
  4. No-break and em spaces. These come in from Word or a web page. They look like an ordinary space and behave like a letter, so a line will not wrap where it should.
  5. Windows line endings. These carry an extra character at the end of every line, and cause odd blank rows when the text moves between systems.

The two switches that are off on purpose

Everything else is on by default because it cannot damage anything. Two steps can, so you have to turn them on yourself.

Turn tabs into spaces ruins indented code, where the tabs are the structure. Only use it on prose.

Join every line into one paragraph is the right fix for text copied out of a PDF, where every printed line arrives as its own line. On anything else it destroys the layout completely.

This is not the same as removing hidden characters

Two different problems, and it is worth being clear about which one you have.

This tool deals with whitespace: real spaces, real tabs, real line breaks. Too many of them, or in the wrong places.

Some characters are invisible in a stronger way. They take up no room at all, and tidying spaces will never touch them, because they are not spaces. Those are what breaks code that looks perfect, and they need the invisible text remover.

If this tool finds any while it works, it says so and points you there. You will not clean text here and walk away thinking it is spotless when it is not.

Common questions

Nothing looks different. Did it work?

Check the counters next to each step and the line above them. If they all say “nothing to do”, your text was already tidy. If they show numbers, the change is real — it is just made of spaces, so there is nothing to see.

Will it change my actual words?

No. Nothing here touches letters, numbers or punctuation. The two steps that alter how the text is laid out are both switched off until you turn them on.

I pasted text from a PDF and every line breaks in the wrong place.

Turn on Join every line into one paragraph. A PDF stores each printed line separately, so what you copied is a stack of short lines rather than paragraphs. That step puts them back together.

Can I use it on code?

Yes, with one change: leave Turn tabs into spaces switched off, or your indentation goes. Trimming line ends and collapsing blank lines are both safe on code and both worth doing.

Is there a size limit?

Only what your own device can handle. Nothing is uploaded, so there is no file limit and no waiting.