Remove Extra Spaces

Collapse double spaces and tabs into single spaces and trim every line.

About this tool

This tool removes extra whitespace from text: runs of spaces or tabs become a single space, and leading or trailing spaces on every line are trimmed. Useful for cleaning up text copied from websites, PDFs or spreadsheets where the spacing came out messy.

How to use it

  1. Paste the text with messy spacing into the first box.
  2. Optionally tick "Also remove empty lines" to delete blank lines as well.
  3. Copy the cleaned text from the result box.

Common uses

  • Fix double spaces left over from editing or old typing habits
  • Clean up columns copied from a spreadsheet or table, where cells arrive separated by tabs
  • Normalize text extracted from PDFs, which often contains irregular runs of spaces
  • Tidy indented code snippets or log lines before pasting them into a chat or document

Frequently asked questions

Which whitespace characters are cleaned?

Runs of ordinary spaces and tab characters are collapsed into a single space, and whitespace at the start and end of every line is trimmed. Line breaks are kept, so your paragraphs and lists stay intact.

Does it remove empty lines?

Only if you tick the option. By default blank lines are preserved, which keeps paragraph spacing; with the option on, every empty line is deleted so the text becomes one compact block.

Can it remove all spaces entirely?

That is a different job — use the Remove Characters tool on the home page and enter a space as the character to remove.

Is my text private?

Yes. Everything runs in your browser — your text is never uploaded or stored anywhere.