Skip to the content

Remove Extra Spaces

Turn double and triple spaces into single ones and strip the spaces at the start and end of every line.

Spaces and line breaks
Characters
Characters before
0
Characters after
0
Removed
0
Share this tool:TwitterFacebookLinkedInWhatsAppEmail

What counts as an extra space

Before
Name: Jane Doe City: Rotterdam Phone: 010 1234567
After
Name: Jane Doe City: Rotterdam Phone: 010 1234567

Two things happen on this page:

  1. Every run of two or more spaces or tabs inside a line becomes one space.
  2. Spaces and tabs at the start and end of each line are removed.

A single tab between two words is left alone, and that is deliberate. Text copied from a spreadsheet has one tab between its columns, and replacing those would glue the columns together. Two tabs in a row do count as a run, as after "Phone:" in the example.

Line breaks and empty lines are not touched: the page only works within lines.

No-break spaces, which web pages and word processors use to keep something like "10 km" on one line, count as spaces here. A run of them collapses, and at the ends of a line they are trimmed. A single one in the middle of a line stays a no-break space, which matters when the text goes into code or a search field. Tick Remove invisible characters to turn those into ordinary spaces too.

Indentation is lost, since it consists of spaces at the start of a line. Untick Trim spaces around each line to keep it; a deeper indent then still shrinks to one space.

All fourteen clean-ups, to combine as you like, are on the Text Cleaner page, which also remembers what you ticked.

See all 9