Skip to main content
Premier SEO Services

Text tools

Remove Extra Spaces

Collapse double spaces, trim spaces at the start and end of lines, and convert tabs and non-breaking spaces, with a count of the spaces removed.

  • Runs in your browser
  • Free, no sign-up
  • Unlimited use
  • Updated 30 September 2026

Remove Extra Spaces

Paste your text — the result updates as you type

How to use the remove extra spaces

  1. 1Paste your text into Text with extra spaces.
  2. 2Keep the defaults or adjust Replace repeated spaces with one, Trim spaces at the start and end of lines and Tabs.
  3. 3Tick Remove every space if you want no spaces at all.
  4. 4Copy the result from Cleaned text; the footer shows how many spaces were removed.

Example

Input
  Too   many    spaces	here.  
 Second   line. 
Output
Too many spaces here.
Second line.

Default settings. The tab becomes a space and is then collapsed with its neighbors; line breaks are kept. 13 spaces removed.

Collapsing multiple spaces

Replace repeated spaces with one turns any run of spaces (and tabs, unless you keep them) into a single space. Double spaces usually come from typing two spaces after a full stop, from justified text in PDFs, or from joining lines that already ended in a space. Line breaks are never collapsed; to remove those, use remove line breaks.

Trimming line starts and ends

Trim spaces at the start and end of lines removes leading and trailing spaces on every line, not just the first and last. Trailing spaces are invisible but break exact matches in spreadsheets and databases. Leading spaces are indentation, so untick this option for code or nested lists where indentation matters.

Remove spaces before , . ; : ! ? fixes word , and word . typed with a stray space.

Tabs and non-breaking spaces

Tabs can be converted to a single space (default), kept, or removed. Convert non-breaking and other special spaces turns U+00A0 no-break spaces, the en, em, thin and hair spaces (U+2000–U+200A), the narrow no-break space (U+202F) and the full-width ideographic space into normal spaces, so they collapse like any other space.

Non-breaking spaces arrive with text copied from web pages and word processors and look identical to normal spaces. Zero-width characters are not spaces at all; find and remove those with the invisible character tool.

Removing every space

Tick Remove every space to delete all spaces while keeping line breaks, which is useful for phone numbers, card or IBAN numbers, product codes and hex strings copied with spaces in them. With Tabs set to Keep tabs, tabs survive, so tab-separated columns stay aligned.

Is my text private?

This tool runs entirely in your browser. Your text is not uploaded to our servers.

Questions about the remove extra spaces

How do I replace multiple spaces with one?

Paste the text; Replace repeated spaces with one is on by default, so the result already has single spaces.

What is a non-breaking space?

A space character (U+00A0) that stops a line from breaking between two words, used for “10 kg” or “Mr. Smith”. It looks like a normal space, so it can make two identical-looking words fail to match.

Can I remove all spaces?

Yes. Tick Remove every space. Line breaks are kept so your lines stay separate.

Last updated 30 September 2026Maintained by Premier SEO Services

Report a problem