Remove duplicate lines
Paste a list and get it back with every repeated line removed, keeping the first one in its original order. You also see how many lines were removed. Free, and your text stays in your browser.
How to use it
- Paste your list in Your lines, one item per line.
- Tick Ignore uppercase/lowercase to treat Apple and apple as the same line.
- Use Trim spaces at line ends and Keep empty lines as you need.
- Copy the clean list from Unique lines.
Complete guide to removing duplicate lines
What this tool is for
Lists collect repeats without anyone noticing. An e-mail list exported from two systems, a keyword sheet merged from three sources, a log file where the same error appears hundreds of times, a column of URLs copied from several pages: all of them end up with the same line written more than once. Cleaning that by eye is slow and error-prone. This tool reads your text one line at a time, keeps the first copy of every line and drops the later ones. The remaining lines stay in their original order, so nothing is sorted or rearranged.
How it works
Each line is turned into a comparison key and checked against the keys already seen. If the key is new, the line is kept; if it was seen before, the line is skipped. Windows, Mac and Linux line endings are all understood. A single empty line at the very end, left by a final line break, is ignored so it does not count as a line. Accents, punctuation and digits always matter: café and cafe are different lines, and so are item and item,. The comparison happens entirely in your browser, so lists with private data such as customer e-mails are never uploaded.
The three options
| Option | When ticked | When not ticked |
|---|---|---|
| Ignore uppercase/lowercase | Apple, APPLE and apple count as one line; the first one typed is kept as written | Apple and apple are different lines |
| Trim spaces at line ends | Spaces and tabs at the start and end are removed from every line, so "apple " matches "apple" | Lines are compared and returned exactly as typed |
| Keep empty lines | Empty lines stay where they are and are never treated as duplicates | All empty lines are removed |
Worked example
- Paste these six lines in Your lines: apple, banana, apple, cherry, banana, Apple. With the default options the result in Unique lines is
apple,banana,cherry,Apple. The summary shows 6 original lines, 4 kept and 2 removed. The lastApplesurvives because the capital letter makes it a different line. - Now tick Ignore uppercase/lowercase. The result becomes
apple,banana,cherry: 3 lines kept and 3 removed, because Apple is now treated as a copy of apple.
Tips and common mistakes
- If two lines look identical but are not removed, they probably differ in an invisible way: a trailing space (tick Trim spaces at line ends), a different capitalization, or a comma at the end of one line.
- Empty lines are kept by default, so a list with blank separators keeps its structure. Untick Keep empty lines when you want a compact list with no gaps.
- The tool removes repeats but does not sort. If you also want alphabetical order, or want to group similar items first, run the result through the line sorter, which can remove duplicates in the same step.
- Only whole lines are compared. If the same e-mail appears inside two longer lines, those lines are different and both stay.
Related tools
To see exactly what changed between your list before and after, use the text diff checker. To fix stray spaces inside lines before comparing, use the extra space remover.
Questions
Which copy of a repeated line is kept?
The first one. Later copies are removed and the original order of the remaining lines does not change.
What does trimming spaces do?
It removes spaces and tabs at the start and end of each line before comparing, so "apple" and "apple " count as the same line.
What happens to empty lines?
With Keep empty lines on, they stay where they are. With it off, all empty lines are removed.
Is there a size limit?
No fixed limit. Very large lists depend on your browser memory, but thousands of lines are fine.