Text Cleaner
Tidy up messy pasted text — trim lines, collapse spaces, and fix broken line breaks.
Character counts include spaces and line breaks. Cleanups run top-to-bottom in the order listed above, so the “before → after” difference reflects every enabled step.
A text cleaner tidies messy pasted text by fixing its whitespace, not its words. Toggle on the cleanups you need — trim each line, collapse runs of spaces into one, drop blank lines, remove tabs, or join everything into a single paragraph — and copy the tidied result. Your wording, spelling, and punctuation stay exactly the same.
What it fixes
Text copied from a PDF, an email, or a web page often arrives full of whitespace noise: leading indents, double spaces, stray tabs, and blank lines every other row. This tool rewrites only that whitespace. Each option is an independent switch — trim each line removes leading and trailing spaces, collapse multiple spaces turns any run of spaces into a single one, remove blank lines deletes empty rows, collapse extra blank lines reduces a stack of blank rows to one, and remove all line breaks joins the whole thing into one flowing paragraph. Turn on only what a given mess needs.
The order matters
The cleanups run as a fixed pipeline, top to bottom, so results are deterministic. Tabs are converted first, then each line is trimmed, then spaces are collapsed, then blank-line rules apply, and finally line breaks are joined and the whole text is trimmed. Running them in this order means, for example, that a line indented with a tab is trimmed away cleanly rather than leaving a lonely space behind.
- 1 Paste your text. Drop in the messy block — say a paragraph copied from a PDF with double spaces and blank lines between every line.
- 2 Choose the cleanups. Leave the defaults on — trim each line, collapse multiple spaces, and collapse extra blank lines — or switch on removing tabs, blank lines, or all line breaks.
- 3 Watch the count. The before → after character count updates live, so you can see how much whitespace each toggle strips out.
- 4 Check the result. The cleaned text appears in the output box; your words are untouched — only spaces, tabs, and line breaks changed.
- 5 Copy it. Press “Copy cleaned” to put the tidied text on your clipboard, ready to paste into your document or email.
What each option does
Every cleanup is an independent toggle; combine the ones your text needs.
| Option | What it does |
|---|---|
| Remove tabs | Replaces every tab character with a single space. |
| Trim each line | Removes leading and trailing spaces from every line. |
| Collapse multiple spaces | Turns any run of two or more spaces into one space. |
| Remove blank lines | Deletes every empty line so text has no gaps. |
| Collapse extra blank lines | Reduces two or more blank lines in a row down to a single blank line. |
| Remove all line breaks | Joins every line into one paragraph, separated by single spaces. |
| Trim start & end | Strips whitespace from the very beginning and end of the whole text. |
When it helps
Text pasted from PDFs is the classic case — copying a paragraph often inserts a hard line break at the end of every printed line, so “remove all line breaks” rejoins it into readable prose. Forwarded emails pick up leading spaces and stacked blank lines that “trim each line” and “collapse extra blank lines” clear out. General formatting cleanup — pasting between apps, tidying a code comment, or preparing a list — usually just needs the default trio to look right. Because the tool changes only whitespace, it is safe to run on quotes, references, or anything where the exact words must survive.