Remove Duplicate Lines
Paste a list, one item per line, and get it back with the duplicates removed. Ignore case, trim spaces, drop blank lines, sort the result and keep the first or last copy. It runs in your browser and your text is never uploaded.
Your list
Options
Result
How to remove duplicate lines
- Paste your list into the box, one item per line.
- Choose your options: ignore case, trim spaces, remove blank lines, keep the first or last copy, and sort.
- Read the counts, then press Copy result.
How lines are matched
Two lines are duplicates when their text is exactly the same. By default that is case sensitive and counts spaces, so "Apple", "apple" and "apple " are three different lines. Turn on Ignore case and Trim spaces to match them. When you keep the first copy, each line stays where it first appears. Keeping the last copy leaves it where it last appears. Sorting is natural, so item2 comes before item10.
Related tools
Count words and lines with the word counter, change the case of text with the case converter, or generate filler text with the lorem ipsum generator.
See also
- Count words and lines with the word counter.
- Change the case of text with the case converter.
- Generate filler text with the lorem ipsum generator.
Frequently Asked Questions (FAQ)
Paste your list into the box, one item per line. The tool keeps one copy of each line and shows the cleaned list straight away. Press Copy to put it on your clipboard.
Yes, unless you turn on sorting. With sorting off, the lines stay in the order they first appear (or last appear, if you choose to keep the last copy).
If a line appears three times, keeping the first copy leaves it at the position of its first appearance. Keeping the last copy leaves it at the position of its last appearance. The text is the same, only the position can differ.
Not by default, because the match is case sensitive. Turn on Ignore case and they count as the same line. The tool keeps the spelling of the copy it keeps.
They probably differ by spaces at the start or end of the line, which you cannot see. Turn on Trim spaces and they will match.
Sorting is natural, so item2 comes before item10. Choose A to Z or Z to A.
No. The tool runs in your browser and your text never leaves your device.