Text Cleaner

Remove extra spaces, line breaks, duplicates; find & replace.

No upload

Loading tool…

Processing happens on your device using your browser's CPU/GPU. Results are kept only in this tab's memory and are wiped when you click “Clear” or close the page.

About Text Cleaner

Text Cleaner strips the rubbish out of pasted text: extra spaces, blank lines, stray line breaks from a PDF copy, duplicate lines, HTML tags, emojis and curly smart quotes. There is also a find and replace with optional regular expressions. Pick your fixes and the cleaned text appears beside the original as you type, all inside your browser.

How to use Text Cleaner

  1. Paste your text into the left box, or open a .txt, .csv, .md or .log file.
  2. Tick the cleanups you want, such as Remove empty lines, Remove duplicate lines or Strip HTML tags.
  3. Use Remove all line breaks when text copied from a PDF has broken mid-sentence.
  4. Add a Find and Replace pair if needed, and tick Regex for pattern matching.
  5. Copy the cleaned text or download it as a .txt file.

What people use it for

  • Repairing text copied out of a PDF where every line has been broken at the page width
  • De-duplicating and sorting a pasted list of emails, phone numbers or item codes
  • Stripping HTML tags out of content copied from a web page
  • Removing emojis and non-ASCII characters before importing text into an older system

Good to know

Options are applied in a fixed order: HTML stripping and quote straightening first, then find and replace, then the line-level operations. Remove all line breaks joins everything into a single paragraph, so untick it when you are cleaning a list. Remove non-ASCII deletes Hindi and other Indian language characters along with the accents, so use it only when the target system truly needs plain ASCII.

Frequently asked questions

How do I fix text copied from a PDF that breaks mid-sentence?
Tick Remove all line breaks along with Collapse multiple spaces. The text is joined into flowing paragraphs instead of the PDF's fixed line width.
What does Straighten smart quotes do?
It replaces curly quotes, en and em dashes and non-breaking spaces with their plain ASCII equivalents, which stops odd symbols appearing in code and older software.
Can I use regular expressions in Find and Replace?
Yes. Tick the Regex box and your pattern is used as a global regular expression. Leave it unticked and the text is matched literally.
Will Remove non-ASCII delete my Hindi text?
Yes, it strips every character outside basic ASCII, including all Indian scripts and the rupee sign. Only use it when the destination system cannot handle them.