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

Lines in
0
Lines out
0
Duplicates removed
0
Blank lines removed
0

How to remove duplicate lines

  1. Paste your list into the box, one item per line.
  2. Choose your options: ignore case, trim spaces, remove blank lines, keep the first or last copy, and sort.
  3. 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

Frequently Asked Questions (FAQ)

How do I remove duplicate lines from a list?

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.

Does it keep the original order?

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).

What is the difference between keeping the first and 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.

Are Apple and apple duplicates?

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.

Why do lines that look the same stay in my list?

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.

How are numbers sorted?

Sorting is natural, so item2 comes before item10. Choose A to Z or Z to A.

Is my text uploaded?

No. The tool runs in your browser and your text never leaves your device.