Tidy up messy whitespace
This tool cleans up text littered with extra spaces, stray tabs, and too many blank lines — the kind you get after copying from a PDF, email, spreadsheet, or web page. Every cleanup step is an independent toggle, so you fix only what you want and leave the rest alone.
How it works
The cleaner processes your text line by line, applying the options you enable in a fixed order so they combine predictably:
- Tabs to spaces — each tab becomes two spaces.
- Collapse spaces — runs of spaces or tabs within a line shrink to a single space.
- Trim lines — leading and trailing whitespace is removed from every line.
- Blank lines — either remove all empty lines, or collapse consecutive blanks down to one.
- Trim ends — extra blank lines and spaces at the very start and end of the text are stripped.
It only touches whitespace, never the words themselves, and shows a live character count of the result.
Example
Pasting this messy text with trimming, space-collapsing, and blank-line collapsing enabled:
Hello world
Indented line
Last line
produces a tidy version where each line is trimmed, the double spaces become single, the tab becomes two spaces, and the double blank line collapses to one.
Everything happens in your browser; nothing is uploaded.