Whitespace Remover

Trim line edges, collapse whitespace or remove whitespace completely.

Your input is processed in this browser and is not uploaded.

Whitespace Remover

Clean whitespace with a rule matched to the task: preserve lines, make one paragraph or join everything.

How to use it

  1. Paste the source text.
  2. Choose Trim line edges, Collapse all whitespace or Remove all whitespace.
  3. Select Clean whitespace and review the result.

Worked example

For red blue , trimming gives red blue, collapsing gives red blue, and removing all gives redblue. Collapse mode also turns line breaks into spaces.

Limits and troubleshooting

Matching uses JavaScript’s whitespace class, which includes tabs, newlines and many Unicode space characters. Remove-all mode destroys word boundaries; applying it to source code, CSV or prose can change meaning. Trim mode keeps line order but normalizes output newlines. Limit: 100,000 UTF-16 code units.

Frequently asked questions

Which mode preserves paragraphs?

Trim line edges keeps separate lines and blank lines. Collapse mode joins whitespace-separated blocks with one space.

Why does an invisible character remain?

Not every invisible Unicode character belongs to the whitespace class. This is not an all-purpose control-character cleaner.