Remove extra spaces

Collapse double spaces and trim lines.

0 lines · 0 characters

0 lines · 0 characters

Results update as you type.

Runs in your browser. Nothing uploaded.

How to remove extra spaces

  1. Paste your text into Input.
  2. Choose whether to trim lines, convert tabs and remove empty lines.
  3. Copy or download the cleaned-up result.

What counts as extra space?

Any run of two or more spaces in a row, spaces and tabs at the start or end of a line, and blank lines that only contain whitespace. These are invisible on screen but cause real problems: misaligned columns, failed lookups in spreadsheets, and values that look identical but don't match.

Common uses

  • Clean up text pasted from PDFs and web pages before putting it in a document.
  • Fix spreadsheet values that don't match because of hidden leading or trailing spaces.
  • Tidy up code comments, commit messages or log output.
  • Remove the double spaces after full stops that some people still type.