Whitespace Cleaner Online

Trim lines, collapse extra spaces, remove blank lines, and normalize line endings.

INPUT
OUTPUT

When to use Whitespace Cleaner

Normalize spacing and blank lines in plain text.

How to use Whitespace Cleaner

Paste text, choose the cleanup options, and review the output before replacing your original text.

Worked example

Example — verified tool behavior
Default settings: '  A   B  


 C ' → 'A B

C'

How the tool handles input

Processing normalizes line endings first, collapses spaces and tabs if selected, trims lines, handles empty lines, and finally trims the document. Removing empty lines takes precedence over collapsing them.

Limitations

Whitespace can be meaningful in code, Markdown, tables and poetry. Space collapsing targets spaces and tabs, while trim uses JavaScript whitespace rules. No syntax-aware protection or undo history is provided.

Frequently asked questions

Can I preserve indentation?

Disable line trimming and space collapsing. Also review document trimming because it can remove whitespace at the outer edges.

What are the main limitations?

Whitespace can be meaningful in code, Markdown, tables and poetry. Space collapsing targets spaces and tabs, while trim uses JavaScript whitespace rules. No syntax-aware protection or undo history is provided.