Remove extra spaces

Clean up double spaces, tabs and blank lines.

Runs in your browser

What to clean

Output

Paste some text to clean it.

What it does: Remove extra spaces

Copying text from a PDF, a web page or a spreadsheet often drags along double spaces, tabs, blank lines and invisible spaces that mess up the formatting. This tool cleans them up using the options you choose.

It tells you how many characters were removed so you can see what each option does.

How to use it

  1. Paste the text into the input box.
  2. Tick the clean-ups you want and choose what to do with blank lines.
  3. Copy the clean result.

Examples

Text copied from a PDF

Turn on “Join all lines into one paragraph” to remove the line breaks the PDF adds at the end of every line.

A list of data

With “Trim spaces” and “Remove them all” for blank lines you get a clean list to paste into a spreadsheet.

Limits, formulas and assumptions

  • Special spaces include the non-breaking space (U+00A0), thin spaces and zero-width characters, which are invisible but break searches and comparisons.
  • Windows line breaks (CRLF) are normalized to simple line breaks.
  • The text is processed in your browser and not stored.

Frequently asked questions

Why does my text contain spaces I can't see?

Many programs insert non-breaking or zero-width spaces. Turn on “Turn special spaces into normal ones” to normalize them.

Are words changed?

No. Only spaces, tabs and line breaks are touched — except with “Remove every space”, which joins words together.

Can I use it on code?

Carefully: in languages where indentation matters, such as Python or YAML, untick “Trim spaces at the start”.