Whitespace Cleaner

Trim lines and clean up extra spaces, tabs and empty lines.

Runs in your browser Free
Processed locally in your browser.

Clean up copied text

Text copied from PDFs, emails or websites often contains double spaces, invisible trailing spaces, stray tabs and runs of empty lines, which breaks formatting when you paste it elsewhere.

Cleaning options

  • Trim spaces at the start and end of lines
  • Collapse multiple spaces into one
  • Remove empty lines or reduce them to one
  • Replace tabs with a number of spaces

Tick the options you need and get tidy text instantly. Processing happens in your browser.

How to use Whitespace Cleaner

  1. Paste the text to clean.
  2. Tick the cleanup options to apply.
  3. The clean text appears instantly.
  4. Copy the result.

Why use this tool?

Get text ready for publishing or data processing without fixing it by hand.

FAQ

Can I convert tabs to spaces?

Yes. Tabs are replaced with the number of spaces you choose.

Will it fix line breaks in text copied from a PDF?

It removes empty lines and extra spaces. To join lines into paragraphs, use Join / Split Lines.

Does it remove invisible characters?

It cleans spaces and tabs. To find other invisible characters, use the Unicode Inspector.

Related tools