EN

Remove Extra Spaces

Clean the spacing of a text: double spaces, spaces at line ends, tabs and empty lines.

Words: 0 · Characters: 0

How to remove extra spaces

  1. Paste your text. Paste the text in the Text to clean box.
  2. Choose what to clean. Three options are on from the start: double spaces, spaces at line ends, and tabs. Tick Remove empty lines if you also want that.
  3. Copy the result. The clean text appears in the Clean text box. Press Copy to use it.

What are extra spaces?

Extra spaces are spaces that a text does not need: two or more spaces between words, spaces at the start or end of a line, and tabs used as gaps. They often come from text copied out of a PDF, a table or a web page.

They are hard to see but they cause problems, for example in a list that will be sorted, compared or pasted into a form.

Features

  • Double spaces to single spaces across the whole text.
  • Trim the start and end of every line.
  • Tabs replaced with a space.
  • Empty lines removed when you ask for it.
  • Count of the characters removed, and Copy, Select or Download for the result.

The options

OptionWhat it doesOn at the start
Turn two or more spaces into oneEvery run of spaces becomes a single spaceYes
Remove spaces at the start and end of each lineLines begin and end with a character, not a spaceYes
Replace tabs with a spaceEach tab becomes one space, which is then merged with spaces next to itYes
Remove empty linesLines with no text are deletedNo

Line breaks are kept. To join the lines, use the Remove Line Breaks tool, which is linked under Related tools below.

Why the result may not look right

  • A gap is still there. It is made of a special space, such as a no-break space from a web page. The tool cleans normal spaces and tabs only.
  • Code or a table lost its shape. Indentation is made of spaces at the start of lines. Turn off the trim option to keep it.
  • The text stops growing. The box takes up to 500,000 characters.

Related tools

Three other tools on this site clean text. The tool to remove line breaks joins broken lines into paragraphs. The find and replace tool changes or deletes any text you choose. The tool to remove duplicate lines deletes repeated lines.

Is it private?

Yes. The text is cleaned inside your browser. It is not sent to our server and is not saved by us.

Frequently asked questions

How do I remove double spaces from text?
Paste the text in the box. Every run of two or more spaces becomes one space.
Does it remove spaces at the end of lines?
Yes. Spaces at the start and at the end of each line are removed. You can turn this off.
Does it remove line breaks too?
No. Line breaks are kept. It can remove empty lines if you tick that option.
Does it remove all spaces?
No. One space stays between words, so the text remains readable.
Is the Remove Extra Spaces tool free?
Yes. It is free and you do not need an account.