Text Cleaner

Strip line breaks, collapse spaces, dedupe, sort and trim lines.

About the text cleaner

The tidy-up pass for text that came out of a PDF, an email client or a spreadsheet. Remove hard line breaks, collapse runs of spaces, strip blank lines, trim each line, remove duplicates, sort alphabetically, drop leading list numbers and bullets, strip accents, convert smart quotes to plain ASCII, or delete invisible zero-width characters.

Steps are toggles and run in the order listed, so you can stack as many as you need and watch the result update live. Trim, collapse spaces and remove invisible characters are on by default because they are almost always wanted.

Why pasted text is so often broken

PDFs store text as positioned fragments rather than flowing paragraphs, so copying from one inserts a hard line break at the end of every visual line. Paste that into a document and the paragraphs never reflow.

Invisible characters are the subtler problem. Zero-width spaces, soft hyphens and byte-order marks arrive from web pages and rich-text editors, and they break string comparisons, spreadsheet lookups and URL slugs while being impossible to see. The invisible-character step removes them.

Frequently asked questions

How do I remove line breaks from text copied out of a PDF?

Turn on "Remove all line breaks" to join everything into one paragraph, and keep "Collapse runs of spaces" on to tidy up the joins. If you only want to lose the blank lines between paragraphs, use "Remove blank lines" instead.

What are invisible characters and why do they matter?

Zero-width spaces, soft hyphens and byte-order marks are characters with no visible form. They arrive silently from web pages and PDFs and cause values that look identical to compare as different, which breaks spreadsheet lookups and search.

Can I remove duplicate lines?

Yes. Turn on "Remove duplicate lines" and only the first occurrence of each line is kept, in the original order. Combine it with sorting if you want a tidy, deduplicated list.

Does it change my original text?

No. Your input stays in the top box and the cleaned version appears separately. Use "Use as input" if you want to feed the result back through another round.