Remove Duplicate Lines
Delete repeated lines from a list, keep only lines that appear once, and sort the rest A to Z. Free, private and it runs in your browser.
What is a duplicate line remover?
A duplicate line remover reads a list, one item per line, and drops the lines that show up more than once. You end up with a clean list where each entry appears a single time, in the order it first appeared.
Lists get messy fast. You copy email addresses from three spreadsheets and some people are in all three. You merge two keyword lists for a website and half the words overlap. A log file repeats the same warning hundreds of times. Spotting repeats by eye in a long list is tiring and you will miss some. This tool finds them all in a fraction of a second and tells you how many lines it took out.
There are three ways to look for repeats:
- All duplicates keeps the first time a line appears and removes every later copy, wherever it is in the list.
- Only repeats in a row removes a line only when it is the same as the line just above it. Copies further apart stay. This is handy for log files.
- Lines that appear once keeps only the lines that have no copy at all and drops every line that was repeated, including its first appearance.
You can also ignore the difference between capital and small letters, trim spaces at the start and end of each line before comparing, remove empty lines, and sort the result. Sorting understands accents and numbers, so “item 2” comes before “item 10” and Vietnamese words land where a Vietnamese reader expects them.
The work happens in your browser. Your list is never uploaded, so it is safe to use with customer emails or other private data.
How to use the duplicate line remover
- Paste your list into Your text, one item per line. A short sample is there at first so you can see how it works.
- Choose how to find repeats: All duplicates, Only repeats in a row or Lines that appear once.
- Tick Ignore upper/lower case if “Apple” and “apple” should count as the same line.
- Tick Trim spaces if some lines have stray spaces at the start or end.
- Tick Remove empty lines to drop blank lines from the result.
- Choose a sort order: Keep order, A to Z or Z to A.
- Check the Result box and the count of removed lines under it, then press Copy result.
FAQ
Which copy of a repeated line is kept?
The first one. If “banana” appears on lines 3, 8 and 12, the result keeps the one from line 3 and drops the other two. The rest of the list keeps its original order unless you pick a sort.
Are blank lines treated as duplicates?
No. Blank lines are left where they are, so paragraphs and gaps in your text survive. If you do not want them, tick Remove empty lines. Blank lines removed that way are not added to the count of removed duplicates.
What is the difference between all duplicates and repeats in a row?
All duplicates looks at the whole list. Repeats in a row only compares each line with the one just above it. In the list “a, a, b, a” the first mode gives “a, b” and the second gives “a, b, a”.
Why are some lines that look the same not removed?
The most common reason is invisible spaces at the end of a line, or a difference in capital letters. Tick Trim spaces and Ignore upper/lower case and try again.
How long can my list be?
Up to 100,000 characters, which is several thousand short lines. If you paste more, a note appears and only the first 100,000 characters are processed.
Is my list sent to a server?
No. The tool runs inside the page on your device. Nothing is uploaded, and nothing is kept once you close the tab.