How do I remove duplicate lines from a list?
This tool lets you remove duplicate lines and clean up lists in one place. It also removes blank lines, sorts, trims, numbers, adds prefixes, runs find and replace with regex, strips HTML and extracts emails, links or numbers, in your browser.
Lists copied from spreadsheets, logs and web pages are rarely clean: duplicates, blank lines, stray spaces and mixed case. Each fix is a one-click operation, and they can be combined in the order you need.
Paste your text and apply operations: remove duplicate lines (keeping the first occurrence), remove blank lines, trim whitespace, sort alphabetically or numerically, reverse, number lines, add a prefix or suffix, and find and replace with plain text or regular expressions. Extraction modes pull out email addresses, links or numbers, and a strip HTML mode removes tags.
Operations work on lines, so make sure each item is on its own line first. Deduplication is case-sensitive unless you choose otherwise. Everything runs in your browser and nothing is uploaded.
Page updated .
How to use the Text Cleanup and List Tools
- Paste your text or list.
- Choose the operations to apply, in order.
- Copy the cleaned result.
Examples
apple banana apple cherry
apple banana cherry
Contact [email protected] or [email protected]
[email protected] and [email protected] on separate lines
Tips
- Trim whitespace before removing duplicates so "a" and "a " count as the same.
- Sort first when you want to see near duplicates next to each other.
- Use regex find and replace to fix a repeated pattern across a whole list.
Specs & limits
- Operations
- Dedupe, remove blanks, trim, sort, reverse, number, prefix and suffix, find and replace
- Extraction
- Emails, links, numbers
- Regex
- Supported in find and replace
- Unit
- Lines
- Processing
- In your browser
Troubleshooting
›Duplicates remain
Cause: Whitespace or case differs.
Fix: Trim and ignore case first.
›Regex error
Cause: The pattern is invalid.
Fix: Check brackets and escapes.
›Everything on one line
Cause: Items are separated by commas, not new lines.
Fix: Replace the separator with a new line first.
Frequently asked questions
›How do I remove duplicate lines?
Paste the list and apply the remove duplicates operation. The first occurrence of each line is kept.
›Is deduplication case-sensitive?
By default yes. You can ignore case if needed.
›Can I extract email addresses from text?
Yes. The extract emails mode lists every address it finds.
›Can I use regular expressions?
Yes, find and replace supports regex.
›Can I strip HTML tags?
Yes, there is a mode that removes tags and leaves the text.
›Is my data uploaded?
No. Everything runs in your browser.