Text Cleaner — Clean Up Messy Text

Paste text copied from a PDF, email, web page or spreadsheet and tidy it in one pass: trim lines, collapse spaces, remove blank or duplicate lines, strip HTML, fix smart quotes, and more. Everything runs in your browser.

What the text cleaner can fix

Each option is a separate clean-up step, and they run together in a fixed, safe order, so you can switch on exactly the ones you need. The three defaults — trim lines, collapse spaces, remove empty lines — fix most text pasted from a PDF or an email without touching the words themselves.

Clean-upBeforeAfter
Trim lines··First line··First line
Collapse spacesFirst···lineFirst line
Remove empty linesa, blank, blank, ba, b
Remove duplicate linesone two two three (one per line)one two three, first-seen order kept
Remove lines containinglines with DEBUGthose lines dropped (or kept alone with the invert option)
Strip HTML<p>Fish &amp; chips</p>Fish & chips
Straighten quotes“it’s” – done…"it's" - done...
Invisible characterszero-width spaces, BOM, non-breaking spacesremoved or turned into normal spaces
Remove line breaksa paragraph broken at every lineone continuous paragraph
Remove all whitespacea b
c
abc

Presets for common jobs

More text cleaning tools

These single-purpose tools handle jobs that change the order or meaning of the text rather than just cleaning it:

Common questions

How do I clean up text copied from a PDF?

Paste it in with the Standard clean-up preset to trim lines, collapse spaces and remove blank lines. If the PDF broke every line mid-sentence, switch to One paragraph to join the lines back together.

Does the text cleaner change my words?

Not with the default options, which only touch whitespace and empty lines. Options such as removing punctuation, accents or emoji do change characters, so they are off until you tick them.

How do I remove lines that contain a certain word?

Tick Remove lines containing and type one or more words or phrases separated by commas. Every line that contains any of them is dropped; tick Keep only matching lines to do the opposite.

Can it remove HTML tags from text?

Yes. Strip HTML tags removes tags, scripts and styles and decodes entities such as &amp; and &nbsp;, leaving plain text. To tidy HTML code itself, use an HTML formatter instead.

Will it keep one blank line between paragraphs?

Remove empty lines deletes every blank line. If paragraph spacing matters, untick it and use the Whitespace Remover, which can collapse several blank lines into one.

Is my text uploaded?

No. All cleaning happens locally in your browser; nothing is sent to a server.