Skip to content
K Knidox Search…
Writing · Editing

Text Cleaner

Tidy up messy pasted text — trim lines, collapse spaces, and fix broken line breaks.

Try an example — tap to load
Cleanups to apply
Cleaned text
112
Before chars
94
After chars
18
Removed chars

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. 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. 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. 3
    Watch the count. The before → after character count updates live, so you can see how much whitespace each toggle strips out.
  4. 4
    Check the result. The cleaned text appears in the output box; your words are untouched — only spaces, tabs, and line breaks changed.
  5. 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.

OptionWhat it does
Remove tabsReplaces every tab character with a single space.
Trim each lineRemoves leading and trailing spaces from every line.
Collapse multiple spacesTurns any run of two or more spaces into one space.
Remove blank linesDeletes every empty line so text has no gaps.
Collapse extra blank linesReduces two or more blank lines in a row down to a single blank line.
Remove all line breaksJoins every line into one paragraph, separated by single spaces.
Trim start & endStrips 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.

Does it change my words?
No. It only edits whitespace — spaces, tabs, and line breaks. Your spelling, punctuation, capitalisation, and word order are left exactly as you pasted them.
What order are the cleanups applied?
A fixed pipeline: remove tabs, trim each line, collapse spaces, remove blank lines, collapse extra blank lines, remove all line breaks, then trim the whole text. Running top-to-bottom keeps the result deterministic.
What is the difference between “remove blank lines” and “collapse extra blank lines”?
Remove blank lines deletes every empty row, so nothing is separated by a gap. Collapse extra blank lines keeps single blank lines as paragraph breaks but shrinks any stack of two or more down to one.
How does “remove all line breaks” treat spacing?
It joins every line into one paragraph with a single space between them. If “collapse multiple spaces” is also on, any doubles created by the join are reduced to single spaces too.
Which options are on by default?
Trim each line, collapse multiple spaces, and collapse extra blank lines — the trio that fixes most pasted text. Removing tabs, blank lines, and line breaks stay off until you switch them on.
What does the “removed” count mean?
It is how many characters the enabled cleanups stripped out — the before count minus the after count. Counts include spaces and line breaks, so it reflects every whitespace character removed.