Remove duplicate lines
Paste the list into the Text Cleaner and tick "Remove duplicate lines". The first copy of each line stays in place and later repeats are dropped, so the original order is kept. Tick "Ignore case" when "Apple" and "apple" should count as the same, which matters for email addresses and keywords.
Watch out for invisible differences: a trailing space makes "apple " different from "apple". Keep "Trim spaces" switched on to avoid that.
Other common fixes
- Text copied from a PDF often has a line break at the end of every line. "Remove line breaks" joins it back into a paragraph.
- Lists pasted from a web page may contain HTML tags or non-breaking spaces. "Strip HTML tags" and "Collapse repeated spaces" fix both.
- Spreadsheet columns often include blank rows. "Remove empty lines" drops them.
- Sorting: natural sorting keeps "item2" before "item10", which a plain alphabetical sort gets wrong.
Other ways to do it
- Excel or Google Sheets: select the column and use Data > Remove duplicates, or =UNIQUE(A:A) in Google Sheets and Excel 365.
- Command line:
sort -u file.txtremoves duplicates but also sorts;awk '!seen[$0]++' file.txtkeeps the original order. - Code editors: VS Code can sort lines and delete duplicates with the "Sort Lines" and "Delete Duplicate Lines" commands.
Quick FAQ
Does removing duplicates change the order of my lines?
Not in the Text Cleaner. It keeps the first copy of each line where it was, unless you also choose a sort order.
How do I find duplicates without deleting them?
Compare the original and the cleaned text in the Text Diff Checker. The removed lines are highlighted.
Can I remove duplicate words instead of lines?
Turn the words into lines first: find a space and replace it with a line break using a regular expression, then remove duplicates.