Whitespace Cleaner

Trim line edges, collapse extra spaces, replace tabs, or remove blank lines without changing the words.

Input

Whitespace rules

Choose exactly which spacing to change. Line breaks export as LF.

Cleanup rules

Result

Copy or save the cleaned text.

Enter text and choose cleanup rules.

Runs in your browser. Nothing is uploaded.

Also known as: trim spaces, remove blank lines, clean text spacing

How to use

  1. Paste the text with unwanted whitespace.
  2. Enable only the cleanup rules you need.
  3. Clean the text, review the changes, and copy or save the result.

Frequently asked questions

Can I keep indentation?

Turn off trimming to keep spaces at line edges. Turn off collapsing and tab replacement to preserve their original form.

What counts as a blank line?

An empty line or a line containing only spaces or tabs counts as blank.

Does it handle nonbreaking spaces?

Yes. Trimming and collapsing include nonbreaking spaces, often introduced by pasted text.

Does it remove all line breaks?

No. It can remove blank lines, but other line breaks are kept and normalized to LF.