Remove extra spaces

Clean up messy spacing in text with one click.

Runs in your browser. Nothing you type is sent anywhere.

How to remove extra spaces

  1. Paste text that has extra spaces, tabs or blank lines.
  2. Choose which cleanup options to apply.
  3. Copy the cleaned text or download it as a file.

What each option does

OptionWhat it does
Collapse repeated spacesTurns 2 or more spaces or tabs in a row into a single space
Trim each lineRemoves spaces from the start and end of every line
Remove empty linesDeletes any line that's blank or contains only whitespace
Convert tabs to spacesReplaces every tab character with a single space before the other options run

When to run this before another tool

  • Before the word counter or character counter, if extra spaces are throwing off a length check.
  • Before find and replace, if you're searching for an exact phrase that might have inconsistent spacing.
  • After remove line breaks, since joining lines can leave behind a double space where a line break used to be.

Remove extra spaces FAQ

Where do extra spaces usually come from?

They commonly appear after copying text from a PDF, a spreadsheet cell, or an email that used tabs or multiple spaces to line up columns.

Does this remove spaces at the start and end of the whole text, not just each line?

Trimming each line removes leading and trailing spaces from every line, which also clears the very first and last line of the text.

Will this affect a single space between words?

No, single spaces between words are left alone. Only runs of two or more spaces or tabs in a row are collapsed.

Does this remove spaces inside a word, like a typo with a stray space?

No, it only targets spaces, tabs and blank lines between words and lines. It never removes letters or changes the spelling of a word.

What counts as an empty line?

A line with nothing on it, or a line that contains only spaces or tabs once trimmed. Both are removed when the remove empty lines option is on.

Will converting tabs to spaces change how a code block or a table looks?

Yes, a tab used to line up columns in code or a table will collapse to a single space, which can misalign the columns. Skip that option if your text relies on tabs for layout.

Is there a limit to how much text this can clean up?

No, it works on anything from a single sentence to a full document, with no fixed size limit.

Related tools