Text tools

Text Cleaner

Text Cleaner

Remove duplicate and empty lines, extra spaces, line breaks, HTML tags, curly quotes and invisible characters in one pass.

About this tool

About Text Cleaner

Text copied from a PDF, an email chain, a spreadsheet or a web page rarely arrives clean. Lines break in the middle of sentences, the same row shows up three times, spaces pile up, curly quotes upset a CSV import, and invisible zero-width characters break a search or a password field. This cleaner fixes all of that in one pass, with every step under your control. Choose how to treat empty lines (keep, allow at most one in a row, or remove), trim spaces at the start or end of lines, collapse runs of spaces and tabs, and join lines inside paragraphs so PDF text flows again, or join everything into one line with your own separator. Tick boxes remove duplicate lines (optionally ignoring case), strip HTML to readable text, straighten quotes, convert dashes and ellipses to plain ASCII, and swap non-breaking spaces for normal ones. A summary tells you exactly what changed. If you connect your own AI key, an optional Fix and tidy action corrects spelling and broken sentences too. Everything else runs in your browser.

Built and maintained by Abhi JainUpdated

How to Clean Up Text

  1. 1

    Paste your text

    Paste into the Text box, open a .txt, .csv or .html file, or click Sample to see a messy example.

  2. 2

    Choose the clean-up

    Set Empty lines, Trim and Line breaks, then tick what else to fix: Remove duplicate lines, Collapse extra spaces, Strip HTML tags, Straighten quotes and so on.

  3. 3

    Copy the result

    Read the summary of changes under the panes, then Copy or Download the cleaned text, or click Use as input to clean it again.

Text Cleaner: questions and answers

How do I fix line breaks in text copied from a PDF?

Set Line breaks to Join lines in paragraphs. Lines inside a paragraph are joined with a space, while blank lines between paragraphs are kept, so the text flows normally again. Turn on Collapse extra spaces to tidy the gaps PDFs often leave.

In what order are the clean-up steps applied?

HTML is stripped first, then invisible characters, odd spaces, quotes and dashes are fixed, then lines are de-spaced and trimmed, duplicates removed, empty lines handled and finally lines are joined. Because trimming comes before comparing, with Trim set to Both ends "apple" and " apple " count as duplicates.

What are invisible characters and why remove them?

Zero-width spaces, joiners, soft hyphens, byte-order marks and direction marks take no visible space but are real characters. They make searches fail, break CSV columns and cause "invalid characters" errors. To see exactly where they are first, use the Whitespace Visualizer.

Does removing duplicate lines keep the first one?

Yes. The first copy of each line stays where it was and later copies are removed, so the order of your list doesn't change. Blank lines are not treated as duplicates; use the Empty lines setting for those.

Can AI clean the text for me?

Optionally. With your own AI key connected in AI settings, Fix and tidy sends the text in the box to your chosen provider and returns a corrected version you review before it replaces yours (Undo puts the original back). All other cleaning happens on your device and needs no key.