Skip to content
Text Cleanup Tools

Text Cleanup Tools › Spaces and line breaks

Remove Extra Spaces

Collapse runs of spaces, tabs and non-breaking spaces into one space, and trim the edges of every line.

Processed on your device. Nothing is uploaded or stored on a server.

How it works

  1. Paste your text.
  2. Choose whether to trim line edges and whether to keep a leading indent.
  3. Copy the tidy result.

Example

Before
  Dear   customer,

Thank you   for your   order.		It ships   soon.  
After
Dear customer,

Thank you for your order. It ships soon.

What this tool does

Double spaces come from typing habits, justified text, copied tables and exports from older systems. Tabs and non-breaking spaces look like spaces but are different characters, so they survive a normal find and replace. This tool treats ordinary spaces, tabs and non-breaking spaces (the invisible character that web pages use to prevent a line wrap) as the same thing and collapses each run into a single plain space. Line breaks are left alone, so your paragraphs stay where they are. To join the lines as well, use the line break remover.

Common problems

There are still odd gaps after cleaning

The gap may be a zero-width or other invisible character. Run the text through the hidden character remover.

My code or poem lost its indentation

Turn on "Keep leading indentation". It leaves one space at the start of lines instead of removing it.

Questions

Does it remove spaces between words?

No. It only reduces several spaces to one. Words stay separated by a single space.

What is a non-breaking space?

A space character (U+00A0) that stops a line from wrapping at that point. It is common in text copied from web pages and Word.

Will it touch line breaks?

No. Line breaks are kept. Use the remove line breaks tool if you want to join the lines.

Related tools

Last reviewed 2026-10-14.