textcleanups

Remove extra spaces

Remove double spaces, trailing spaces and tabs while keeping your line breaks exactly where they are.

Options

Your text stays in your browser. Nothing is uploaded or saved.

How to remove extra spaces

  1. Paste your text into the first box.
  2. Leave the options on for a full cleanup, or turn off any you don't need.
  3. Copy the result from the result box.

Line breaks are never touched here. If you also want to join lines, use remove line breaks. To clean everything at once, use the all-in-one text cleaner.

The spaces you can't see

Not every space is a normal space. Websites and word processors often use a non-breaking space to stop two words splitting across lines. It looks identical, but search, spreadsheet formulas and code treat it as a different character. That's why a cell that seems to say London sometimes won't match London. This tool replaces non-breaking spaces and the other unusual space characters with ordinary ones.

Do you need two spaces after a period?

No. Two spaces after a sentence is a habit from typewriters, where every letter had the same width. Major style guides, including APA, Chicago and AP, now call for one space. Collapsing repeated spaces fixes this throughout a document in one step.

Common uses

  • Cleaning text pasted from PDFs, websites or old documents
  • Fixing spreadsheet values that won't match because of hidden spaces
  • Removing indentation from code or copied lists
  • Converting two spaces after a period to one

Questions

Will this remove the spaces between words?

No. Repeated spaces are collapsed to a single space, so words stay separated.

Does it change my line breaks?

No. Each line is cleaned separately and your line breaks stay as they are.

How do I remove extra spaces in Excel?

Use the TRIM function, for example =TRIM(A1). Note that TRIM doesn't remove non-breaking spaces, which this tool does.