Remove Extra Spaces Online

Paste your text to turn double spaces into one, trim spaces at the start and end of lines and fix invisible spaces copied from Word, Excel and websites.

Free to use · No sign-up · Your text stays in your browser

What to clean

0 Characters0 Words0 Lines

0 Characters0 Words0 Lines

Private by design: your text is converted in your browser and is never uploaded or saved.

How to remove extra spaces

  1. Paste your text into the Your text box.
  2. The most common fixes are already on: double spaces, spaces at the start and end of lines, tabs and invisible spaces.
  3. Tick Remove empty lines, Remove spaces before punctuation or Remove all spaces if you need them.
  4. Click Copy result and paste the clean text where you need it.

What each option does

  • Turn double spaces into one: Hello····world becomes Hello world. The most common problem in copied text.
  • Remove spaces at the start and end of lines: removes the indents and trailing spaces you can't see but that break alignment and forms.
  • Turn tabs into spaces: text from spreadsheets and code often uses tabs. They become normal spaces.
  • Fix invisible spaces: Word, Excel and websites often use non-breaking spaces that look normal but aren't. They stop formulas, searches and form checks from working. This option turns them into real spaces and deletes zero-width spaces.
  • Remove empty lines: deletes blank lines, so every line has text on it.
  • Remove spaces before punctuation: Hello , world ! becomes Hello, world!, and ( note ) becomes (note).
  • Remove all spaces: for codes, phone numbers and IDs: AB 12 34 becomes AB1234. Line breaks are kept.

Examples

In this table, · stands for one space so you can see them.

BeforeOptionAfter
Hello····worldDouble spaces into oneHello world
···Total:·42···Trim line starts and endsTotal: 42
Hello·,·world·!Spaces before punctuationHello, world!
+44·20·7946·0958Remove all spaces+442079460958

Remove extra spaces in Word, Excel and Google Docs

  • Excel and Google Sheets: =TRIM(A1) removes extra spaces, but Excel's TRIM does not remove non-breaking spaces. Use =TRIM(SUBSTITUTE(A1,CHAR(160)," ")) in Excel, or paste the column here.
  • Word: press Ctrl + H, tick Use wildcards, type ( ){2,} in Find and \1 in Replace, then click Replace All.
  • Google Docs: open Edit → Find and replace, tick Match using regular expressions, type {2,} in Find and a single space in Replace.

More text clean-up tools

Text from a PDF with broken lines? Remove line breaks first. Need to swap words or symbols? Use Find & Replace. Check the final length with the word counter, or fix capitals with the case converter.

Frequently asked questions

Why doesn't Excel's TRIM remove all spaces?

Because some of them aren't normal spaces. Text copied from websites and Word often contains non-breaking spaces (character 160), which TRIM ignores. Turn on Fix invisible spaces here, or use SUBSTITUTE(A1,CHAR(160)," ") before TRIM.

What is a non-breaking space?

A special space that stops two words from being split across lines, such as in “10 km”. It looks like a normal space but computers treat it differently, which is why searches and formulas sometimes fail on copied text.

Does this remove line breaks too?

No. Line breaks are kept, so your paragraphs stay as they are. Only Remove empty lines deletes blank lines. To join broken lines from a PDF, use Remove Line Breaks.

Is my text uploaded?

No. Everything runs in your browser on your own device. Your text is never sent anywhere or saved.