About this tool
Text Cleaner tidies messy text and lists without a spreadsheet or a script. Paste anything (email addresses exported from three places, a word list full of repeats, a paragraph copied from a PDF with a break on every line) and switch on the steps you need. The result updates as you type, with a count such as “312 lines → 248” and what each step did, like “64 duplicates removed”.
There are thirteen steps: remove duplicate lines, remove empty lines, trim each line, collapse extra spaces, remove line breaks, sort, add or remove line numbers, add a prefix or suffix, find and replace (plain or regular expression), remove punctuation, remove emoji, remove HTML tags, and turn curly “smart” quotes into straight ones. They run from top to bottom, and the arrows let you change the order, because sorting before or after removing duplicates can matter.
Your set-up is remembered in this browser for next time, and “Undo” brings back your text after you replace it. The text itself is never uploaded or stored: all the work happens on your device.
How to use Text Cleaner
- Paste your text into “Your text”, or press “Open” or drop a .txt file on the box.
- Switch on the steps you want in “Clean-up steps”, or start from a quick set-up such as “Tidy a list”.
- Adjust each step’s options, and use ↑ and ↓ to change which runs first.
- Check the line count and notes above the result.
- Press “Copy” or “Download”, or “Use as my text” to clean the result again. “Undo” reverses it.
A pasted list of 312 email addresses with stray spaces, blank lines and repeats, run through Trim, Remove empty lines and Remove duplicate lines (ignoring case), might show “312 lines → 248” with notes such as “12 empty lines removed” and “52 duplicates removed”.
Features
- Remove duplicate lines: keep the first or last copy, ignore case, ignore spaces at the ends, leave blank lines alone.
- Remove empty lines, or keep exactly one blank line between paragraphs.
- Remove line breaks: join with a space, nothing, a comma or your own separator, keep paragraphs, and rejoin words hyphenated across lines.
- Sort A → Z, Z → A, natural order (2 before 10), shortest or longest first, reverse, or shuffle.
- Add line numbers (five styles, any start number, zero padding) or remove existing numbers and bullets.
- Find and replace with match case, whole words and regular expressions, including $1 groups and \n for line breaks.
- Remove HTML tags and decode entities, remove punctuation, remove emoji, straighten smart quotes and dashes.
- Trim lines, collapse runs of spaces and tabs, and add a prefix or suffix to every line.
- Live before and after line counts, a note for every step, and up to 30 levels of undo.
Tips and good to know
- Order matters: trim before removing duplicates, so “apple” and “apple ” count as the same line. The default order already does this.
- Natural sort is what you want for file names and numbered items: it puts “photo 2” before “photo 10”, where A → Z would not.
- For text copied out of a PDF, try “Fix text from a PDF”: it joins broken lines, keeps paragraphs and repairs words split with a hyphen.
- Sorting moves blank lines to the end. Switch on “Remove empty lines” first if you don’t want them at all.
- Regular expressions use the multi-line setting, so ^ and $ match the start and end of each line. A broken pattern shows a message instead of changing your text.
Frequently asked questions
Is my text uploaded or saved?
No. Every step runs in your browser and the text never leaves your device. Only your steps and their settings (including any find-and-replace words) are remembered in this browser, never the text itself.
Is it free? Is there a size limit?
It is free with no sign-up. There is no limit set by the tool, and files up to 50 MB can be opened. A list of 100,000 lines takes a fraction of a second on a typical computer.
Does it work on a phone or offline?
Yes. On a phone the steps sit between your text and the result. Once the page has loaded, everything keeps working without a connection.
How do I remove duplicates but keep the original order?
Switch on only “Remove duplicate lines”. Lines stay in their original order and only the repeats are taken out. Choose “Keep last” if the newest copy, lower down, is the one to keep.
Can I turn a column of items into a comma-separated list?
Yes. Switch on “Remove line breaks” and choose “Comma”. Each line becomes one item, joined with a comma and a space. To put each item in quotes, also switch on “Add prefix / suffix” with " in both boxes; it runs before the join.
Will removing punctuation break words like “don’t”?
Not by default. “Keep apostrophes and hyphens inside words” leaves don’t and well-known whole while removing commas, full stops, brackets and other marks. Untick it to remove those too.
Page last reviewed
