Remove Extra Spaces

Replace runs of spaces and tabs with a single space and trim the start and end of every line.

Tip: press Ctrl + Enter to run.

About the Remove Extra Spaces

Extra whitespace sneaks into text all the time: two spaces after a full stop, tabs pasted from a spreadsheet, or invisible non-breaking spaces copied from a web page. It makes text look uneven and can break searches, comparisons and data imports.

This tool replaces any run of spaces, tabs or non-breaking spaces with one ordinary space and removes whitespace at the start and end of each line. Line breaks are kept, so lists and paragraphs stay exactly where they were. If you also want to join lines, use the Remove Line Breaks tool afterwards.

How to use it

  1. Paste your text into the input box.
  2. Click Remove Extra Spaces.
  3. Check the result, then copy or download it.

Example

Input
   This  sentence   has	too    many   spaces.  
  Second   line   here.   
Result
This sentence has too many spaces.
Second line here.

When to use it

  • Cleaning product names or addresses before importing them into a database.
  • Removing the double space after full stops in older documents.
  • Tidying text pasted from spreadsheets that contains tab characters.
  • Normalising values so that duplicate checks and searches work reliably.

Frequently asked questions

Does this remove line breaks as well?

No. It only changes spaces and tabs within each line. Your line breaks stay as they are.

What is a non-breaking space?

A non-breaking space looks like a normal space but stops a line from wrapping at that point. Web pages often use it, and it can cause problems when text is compared or imported. This tool converts it to a normal space.

Can I remove all spaces completely?

This tool keeps one space between words so that text stays readable. To remove characters entirely, try Remove Special Characters or Find and Replace.

Is the text I enter kept private?

Yes. The Remove Extra Spaces runs entirely in your web browser, so your text is never uploaded to or stored on our servers. Like most free websites, TextForge shows ads from Google, which may use cookies. See our Privacy Policy for details.