Skip to content
Free text tool

Whitespace cleaner

This whitespace cleaner tidies text copied from documents, emails, PDFs or code. It removes stray spaces at line ends, controls blank lines and can squeeze repeated spaces down to one.

  • Runs in your browser
  • Free, no account needed
  • Copy or download the result
Private: runs on this device

Input

30 characters

Result

First line

Second  line

Example

Input
First line   


Second  line	
Result
First line

Second  line

How to use the whitespace cleaner

  1. Paste your text into the Text box.
  2. Set Trim outer blank space, Blank lines and Spaces inside lines.
  3. Enter a number in Spaces per tab; 0 keeps tabs as they are.
  4. Press Run, then Copy result or Download.

How it works

Spaces and tabs at the end of every line are always removed, and Windows line endings become plain line breaks.

Blank lines can be kept, limited to at most one in a row, or removed completely.

Collapse repeated spaces and tabs turns any run of spaces or tabs into one space, including indentation at the start of a line.

Spaces per tab replaces each tab with that many spaces, from 0 to 16. It does not line text up to tab stops.

Inside lines, only regular spaces and tabs are cleaned, so characters like non-breaking spaces stay. If cleaning would leave no text, you get an error.

Everything runs in your browser. Your input is not uploaded or stored.

Questions and answers

How do I remove extra spaces from text?

Paste the text, set Spaces inside lines to Collapse repeated spaces and tabs, and press Run. Double spaces become single spaces.

How do I remove blank lines?

Set Blank lines to Remove to delete every empty line, or to Keep at most one to leave single gaps between paragraphs.

Can I convert tabs to spaces?

Yes. Enter a number from 1 to 16 in Spaces per tab, and each tab is replaced by that many spaces.

Is my text uploaded?

No. Cleaning happens in your browser, and your text never reaches a server.

All 100 SnowRock tools