Duplicate Line Remover & Sorter

Clean a list: duplicates out, counts shown.

Runs in your browser. Nothing is uploaded — your input is processed on this device and discarded when you close the tab.

Duplicate Line Remover & Sorter

How to use this tool

  1. Paste your lines, one per line.
  2. Tick the sort box only if you want alphabetical order — otherwise the original order is kept.
  3. Press Remove duplicates and read the counts: before, after and removed.

Worked example

With the sample (apple, banana, apple, cherry, banana), the result is apple, banana, cherry: 5 lines before, 3 after, 2 removed. The first occurrence of each line is the one kept, so if the same line appears with different surrounding content on different lines, only the exact line text matters.

What this tool does not do / Limits

Comparison is exact and case-sensitive: “Apple” and “apple” are different lines, and a line with a trailing space is different from the same line without one. Blank lines count as lines too, so a list with empty lines will keep one blank line. This tool does not edit inside a line — it only removes whole duplicate lines.

Frequently asked questions

Which occurrence is kept?

The first. If a line appears three times, the first stays in place and the other two are removed.

Does sorting happen before or after removing duplicates?

After. Duplicates are removed first, then the survivors are sorted, so the counts describe the same list either way.

Related tools