Skip to content

Remove Extra Spaces

Clean up spacing in pasted text: double spaces, stray tabs, trailing spaces and runs of blank lines.

Processed locally in your browser

Options
0 chars · 0 lines
The result will appear here.

What is Remove Extra Spaces?

Copied text often carries extra whitespace: two spaces after a period, tabs, trailing spaces, non-breaking spaces from web pages and stacks of blank lines. This tool normalizes all of it in one pass, with a checkbox for every step.

You can collapse repeated spaces (and tabs) to a single space, trim the start and end of each line, convert non-breaking and other Unicode spaces to normal ones, remove all blank lines or limit consecutive blank lines to a number you choose, and optionally remove spaces before punctuation such as commas and periods. The notes tell you how many characters were removed.

How does it work?

  1. Paste your text with the extra spacing.
  2. Keep the defaults (collapse spaces, trim lines and text, convert special spaces) or switch each option on and off.
  3. Set how many consecutive blank lines to keep (0 means unlimited), then copy the tidy text.

Common use cases

  • Cleaning text copied from PDFs, e-mails or web pages before publishing.
  • Removing double spaces after periods from an old document.
  • Normalizing whitespace before comparing two versions of a text.
  • Compacting pasted lists and addresses.

Examples

Try this input in the tool above:

Input
  Too    many   spaces   here.  



  And   here   too !  	 Tabs		as well.  
Output
Too many spaces here.

And here too ! Tabs as well.

Privacy

Remove Extra Spaces runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

Removing the space before punctuation is wrong for French, which requires a space before ! ? : ; and is therefore off by default. Spaces inside code blocks, tables or ASCII art will also be collapsed if the option is on.

Frequently asked questions

Are line breaks removed?

No. Only spaces and tabs are collapsed, and blank lines are removed or limited only if you choose so.

What are non-breaking spaces?

Invisible space characters (U+00A0 and others) that look like spaces but are not matched by normal search. The tool converts them to ordinary spaces by default.

More tools in Text Tools →