Skip to content
Utilboxes

Remove Duplicate Lines

Paste a list with one item per line to remove repeated lines and see how many were taken out. The first occurrence of each line stays in place, so the order is kept. Choose whether case and trailing spaces matter, or invert it to list only the duplicates. Large lists stay fast, and nothing is uploaded.

Runs entirely in your browser

Updated

How to use Remove Duplicate Lines

  1. 1Paste your list, one item per line.
  2. 2Decide whether case and surrounding whitespace should matter.
  3. 3Choose to keep unique lines, or invert it to keep only the duplicates.
  4. 4Copy the cleaned list.

How it works

Lines are compared using a hash set, which keeps the work proportional to the number of lines rather than to their square — so a hundred thousand lines deduplicate as fast as a hundred.

The comparison options matter more than they look. With case sensitivity off, 'Apple' and 'apple' are treated as the same line and the first occurrence is kept. With whitespace trimming on, lines that differ only by trailing spaces — extremely common in data pasted from spreadsheets — collapse together.

Order is always preserved: the first occurrence of each line stays where it was. Inverting the mode shows only the lines that appeared more than once, which is a fast way to find accidental repeats in a list you expected to be unique.

Your text is processed by JavaScript running in this page and is never sent over the network. That matters when you are pasting a draft, a client brief, meeting notes or anything else you would rather not hand to a server.

Tips and common mistakes

  • Turn on whitespace trimming for lists pasted from spreadsheets, where trailing spaces are common.
  • Turn off case sensitivity for email addresses and names, so different capitalisation still counts as a duplicate.
  • Invert the mode to see only the repeated lines when you are checking a list that should be unique.
  • Sort the result afterwards with Sort Lines if you want it in alphabetical order.

Frequently asked questions

Does it keep the original order?
Yes. The first occurrence of each line stays in place; later copies are removed.
Can I find the duplicates instead of removing them?
Yes. Invert the mode and you get only the lines that appeared more than once, with their counts.
How many lines can it handle?
Hundreds of thousands without trouble. The work scales linearly, so large lists stay fast.
How do I remove duplicate email addresses?
Paste one address per line, turn off case sensitivity and turn on whitespace trimming, so “Ann@Example.com ” and “ann@example.com” count as the same.
Can I do this in a spreadsheet instead?
Spreadsheets have a remove-duplicates command for columns. This is quicker for a list you have just copied, and it shows how many lines it removed.
Is my list uploaded?
No. The duplicates are removed by the page in your browser.

Guides