Word and Text Tools
Word and Text Tools › Clean up and compare text › Remove extra spaces

Remove extra spaces

How do I use a remove extra spaces? Collapses runs of spaces and tabs into single spaces and trims each line.

What it doesCollapses runs of spaces and tabs into single spaces and trims each line.
Exact ruleWithin each line every run of spaces and tabs becomes one space, and spaces at the start and end of the line are removed.
Example text too many spaces here ⏎ ⇥and a tab
Example resulttoo many spaces here ⏎ and a tab
LimitsSpaces inside code or tables are collapsed too: do not use it on text where spacing matters.
Where it runsIn your browser: your text is never uploaded, stored or logged.

Related tools

Remove line breaks Remove duplicate lines Sort lines A to Z Sort lines Z to A Reverse text Reverse line order Find and replace Text compare (diff)

All tools in Clean up and compare text

How to use the remove extra spaces

  1. Paste text with uneven spacing.
  2. Copy the cleaned result.
  3. Line breaks are kept; use the remove line breaks tool to join lines.

How it works

Within each line every run of spaces and tabs becomes one space, and spaces at the start and end of the line are removed.

Spaces inside code or tables are collapsed too: do not use it on text where spacing matters.