Whitespace Cleaner
Clean up whitespace in your text: trim, collapse spaces, strip blank lines, normalize line endings, and more.
About the Whitespace Cleaner
Combine six whitespace-cleaning steps: trim each line, collapse runs of spaces and tabs, remove blank lines, normalize CRLF or CR endings to LF, remove trailing spaces and tabs, or remove all whitespace. Check the steps you need and copy the result. Strip All Whitespace overrides the other steps.
Features
- Combine cleaning steps with checkboxes
- Trim each line
- Collapse spaces and tabs
- Remove blank lines
- Normalize line endings to LF
- Remove trailing spaces and tabs
- Strip all whitespace
- Live preview and copy
How to use this tool
The Whitespace Cleaner works right in your browser — no signup, no installation. Follow these steps:
- Paste your text into the input area.
- Select the whitespace cleaning mode you need.
- View the cleaned output instantly.
- Click Copy to save the cleaned text to your clipboard.
Frequently asked questions
What is the difference between Trim and Collapse?
Trim removes whitespace from the beginning and end of each line. Collapse reduces multiple consecutive spaces within lines to a single space while preserving single spaces between words. Use both together for maximum cleaning.
What are line ending formats?
LF is the line-ending target of this tool. The normalization step converts CRLF and CR to LF; there is no CRLF or CR output selector.
Does Strip All Whitespace remove spaces between words?
Yes. Strip All Whitespace removes every whitespace character including spaces, tabs, and newlines. This will cause all text to run together. Use this mode only when you need completely unspaced output.
Using the results
Bulk text edits that would take ages by hand happen in one step with the Whitespace Cleaner. It applies your changes the moment you make them, entirely in the browser, so your content stays on your device and the result is ready to copy immediately.