Remove extra spaces

Collapse repeated spaces and tabs, and trim the start and end of lines.

Input

Output

Removed 3 spaces
Words 28Characters 193Without spaces 161Sentences 4Lines 9Paragraphs 2Reading time < 1 min

About Remove Extra Spaces

Double spaces after full stops, tabs left over from a spreadsheet, and trailing spaces at line ends are easy to miss and annoying to fix by hand. This tool collapses each run of spaces and tabs to a single space and trims the start and end of every line, keeping your line breaks.

If you need every space gone, for example in a phone number or a code, switch to removing all spaces and tabs. The cleanup happens entirely in your browser.

How to use it

  1. Paste your text into the Input box.
  2. Choose “Extra spaces only” or “All spaces and tabs”.
  3. Keep Trim each line on to remove leading and trailing spaces.
  4. Copy the cleaned text; the note shows how many spaces were removed.

Frequently asked questions

Are line breaks removed too?

No. Only spaces and tabs are affected and your lines stay as they are. Use Remove line breaks or Remove empty lines for those.

Will it remove indentation?

With Trim each line on, leading spaces and tabs are removed, so indentation goes. Turn trimming off to keep a single space where the indentation was.

Does it handle non-breaking spaces?

It targets regular spaces and tabs. Non-breaking spaces copied from web pages are left as they are.

Related tools