Remove Duplicate Lines

Clean a list in one step: remove duplicates and empty lines, then sort, reverse, shuffle or number what is left.

Paste lines to process them.

How to use the duplicate lines & sort

  1. Paste your list into the left box, with one item on each line, or open a text file.
  2. Keep Remove duplicate lines on, and add options such as Ignore case or Remove empty lines.
  3. Choose an order: sort A–Z, Z–A, by length, reverse or shuffle.
  4. Copy the result or download it. The first occurrence of each line is the one that stays.

About this tool

Long lists often contain repeats: email lists, keyword lists, product codes, URLs or names collected from several sources. This tool removes the repeats and gives you a clean list, and it tells you how many lines were removed.

Sorting works with your language’s alphabet. With Natural number order switched on, item 2 comes before item 10, which matters for file names and numbered lists. Shuffle and Reverse are handy for random draws and for flipping a list upside down.

Frequently asked questions

Which duplicate is kept?

The first one. Later copies of the same line are removed and the original order is kept unless you choose a sort order.

Does it treat “Apple” and “apple” as duplicates?

Only if you tick Ignore case. By default they are different lines.

What does Natural number order do?

It sorts numbers inside text by value rather than letter by letter, so “file2” comes before “file10”.

Related tools