Whitespace Trimmer / Remover
Clean up messy text by trimming, collapsing, or stripping spaces, tabs, and blank lines.
About this tool
The Whitespace Trimmer / Remover cleans up text that has accumulated stray spaces, inconsistent tabs, or extra blank lines — the kind of mess that comes from copy-pasting between a PDF, an email client, and a text editor. Rather than a single one-size-fits-all "clean" button, this tool exposes independent toggles so you control exactly which cleanup operations run.
Trim leading/trailing whitespace removes stray spaces at the start and end of each line. Collapse multiple spaces to one turns runs of repeated spaces into a single space. Remove blank lines drops any line that is empty or whitespace-only. Tab handling is a three-way choice: leave tabs untouched, convert them to spaces, or remove them entirely.
A separate "remove ALL whitespace" toggle strips every space, tab, and newline entirely — useful for generating a compact single-token string from a phrase.
Everything runs synchronously in the browser with plain regular expressions — no library dependency, no network call.
