Pasting from PDFs, spreadsheets, or chat apps often leaves double spaces, stray tabs, and awkward spaces before punctuation. This tool cleans all of that in one pass, so copy you reuse looks properly typeset.
How it works
You pick which rules to apply and the tool runs them in sequence over your text:
- Collapse repeated spaces replaces any run of spaces or tabs with a single space.
- Remove spaces before punctuation deletes a space sitting directly before
, . ; : ? !. - Trim line ends removes leading and trailing whitespace from each line while keeping the line breaks.
- Strip every space deletes all space characters entirely — handy for collapsing a code, ID, or number that should have none.
The rules use simple string replacements, so the result updates instantly as you toggle options or edit the input.
Example
Input (with double spaces and a space before the period):
Hello world , this is a test .
With collapse + remove-before-punctuation + trim:
Hello world, this is a test.
| Option | Before | After |
|---|---|---|
| Collapse | a b | a b |
| Before-punct | word . | word. |
| Strip all | 1 2 3 | 123 |
Everything runs in your browser — nothing is uploaded.