Whitespace Cleaner
Collapse repeated spaces, trim lines, drop empty lines and strip invisible characters.
Text & data Client-side Regex
Tool preview
How to use it
- 01
Paste the text.
- 02
Choose which cleanups to apply.
- 03
Copy the result.
Limitations
- ! Collapsing spaces will also alter code indentation.
- ! Invisible character removal targets zero-width and direction marks, not all control characters.
FAQ
Why does my text look identical but compare differently?
Zero-width spaces and non-breaking spaces are invisible but count as content; this tool removes them.
Does it change line endings?
It normalises output to line feeds.
Is it safe for code?
Disable space collapsing before cleaning source files.
Files never leave your device
Processing happens in your browser using the File API, WebAssembly and Web Workers. There is no upload endpoint.
Technical details
- Processing
- Client-side
- Implementation
- Regex
- Category
- Text & data
- Network requests
- None while processing