Whitespace Cleaner
Trim, collapse multiple spaces, normalise tabs, drop blank lines, strip zero-width and non-breaking spaces.
Quick answer: Trim, collapse multiple spaces, normalise tabs, drop blank lines, strip zero-width and non-breaking spaces.
Last updated
Frequently asked questions
- How do I remove extra spaces in text?
- Toggle "Collapse multiple spaces" — runs of two or more spaces become a single space throughout the text.
- How do I trim leading and trailing spaces?
- Toggle "Trim each line" to strip whitespace at the start and end of every line, or use "Trim only the start/end" for the whole text.
- How do I replace tabs with spaces?
- Toggle "Normalise tabs" and choose 2 or 4 spaces per tab. The whole text is converted in one pass.
- Why does copied text have weird spacing?
- Source apps often use non-breaking spaces (NBSP), zero-width spaces or unusual indentation. The cleaner detects and removes these so the text behaves like normal whitespace.
- Can I remove multiple blank lines?
- Yes. Toggle "Collapse blank lines" to leave only a single blank line between paragraphs, or "Remove all blank lines" to delete them entirely.
- How do I normalize whitespace in code?
- Use "Normalise tabs" to standardise indentation, "Trim each line" to drop trailing whitespace, and "Collapse multiple spaces" to fix accidental double-spacing — but be careful in languages where indentation matters (Python, YAML).
- What's the difference between a space and a non-breaking space?
- A regular space (U+0020) lets text break across lines. A non-breaking space (U+00A0) keeps two words together. Pasting from Word often introduces NBSPs that look the same but break searches and joins.
- Can I remove invisible characters?
- Yes. Toggle "Strip zero-width characters" to remove U+200B, U+200C, U+200D and the BOM — common culprits for invisible bugs in pasted text.
- Will cleaning whitespace change meaning?
- Not for prose. For code or whitespace-sensitive formats (Python, YAML, Makefile) be careful: only enable "Trim each line" and "Strip zero-width" — leave indentation alone.
- Can I clean whitespace on mobile?
- Yes. The cleaner works in any mobile browser.