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 does | Collapses runs of spaces and tabs into single spaces and trims each line. |
|---|---|
| Exact rule | Within 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 result | too many spaces here ⏎ and a tab |
| Limits | Spaces inside code or tables are collapsed too: do not use it on text where spacing matters. |
| Where it runs | In 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
- Paste text with uneven spacing.
- Copy the cleaned result.
- 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.