Remove Extra Spaces

Clean up double spaces, stray tabs, and blank lines left behind by copying and pasting.

0 words · 0 characters

Example

Before
  Total:    $48.00	(tax incl.)  
  Thank  you  for  shopping!
After
Total: $48.00 (tax incl.)
Thank you for shopping!

What counts as whitespace

Regular spaces, tabs, and non-breaking spaces, the invisible character that often comes along when you copy from web pages and Word. Line breaks are only removed when you choose “Remove blank lines”, and then only the empty ones.

Two spaces after a period

“Replace repeated spaces with one” also fixes the two-spaces-after-a-period habit, which most current style guides no longer recommend.

Why extra spaces cause problems

Extra spaces are mostly invisible, which is why they cause trouble. A trailing space can make a spreadsheet lookup fail, two spaces between words can break a search, and the non-breaking spaces copied from websites can stop text from wrapping. Cleaning them before you import, compare, or publish text avoids those silent errors.

Choosing the options

For ordinary text, the defaults (trim lines, collapse repeated spaces, convert tabs) are almost always what you want. Turn on “Remove blank lines” when pasting a list. “Remove all spaces” is for values that should contain no spaces at all, such as phone numbers, card numbers copied with spaces, or codes.

Frequently asked questions

Does it remove line breaks?

Only empty lines, and only when “Remove blank lines” is on. To join lines into paragraphs, use Remove line breaks.

What is a non-breaking space?

A space character (U+00A0) that stops a line from wrapping at that point. Web pages and Word use it, and it looks identical to a normal space. This tool treats it like any other space.

How do I remove extra spaces in Excel?

The =TRIM(A1) function removes leading, trailing, and repeated spaces, but it does not remove non-breaking spaces. Paste the column here if TRIM leaves gaps.