Whitespace Normaliser

Collapse multiple spaces, trim, and fix invisible space characters

Ad placeholder (leaderboard)

Pasted text often carries invisible baggage: non-breaking spaces from PDFs, zero-width characters from web pages, double spaces, and trailing whitespace. This tool normalises all of it to clean, predictable ASCII spacing.

How it works

The cleaner applies a sequence of substitutions:

1. Remove zero-width chars: U+200B, U+200C, U+200D, U+FEFF
2. Map exotic spaces to a plain space:
   U+00A0 (NBSP), U+2007, U+202F, U+2009, U+3000 …
3. Replace tabs with a space
4. Collapse runs of spaces to one (optional)
5. Trim leading/trailing whitespace per line (optional)
6. Collapse 3+ blank lines to a single blank line

The result uses only ordinary U+0020 spaces and newlines, so the text becomes consistent and safe to compare or store.

Example and tips

A heading copied from a slide deck that reads Quarterly Report with a hidden non-breaking space and trailing spaces becomes a clean Quarterly Report. If two strings look identical but fail an equality check, run both through here first — an invisible zero-width character is the usual culprit.

Ad placeholder (rectangle)