Developer Duplicate Line Remover

Duplicate Line Remover

Paste a list and remove duplicate lines, keeping the first occurrence of each.

Removed 4 duplicate lines.

How to use this tool

Paste one item per line. The first copy of each line is kept where it was, later copies are removed, and the number removed is shown. Three switches decide what counts as the same line: capital letters, spaces at the ends of lines, and whether blank lines are left alone.

Worked example: an email list from two sources

asha@example.com
Ravi@Example.com
asha@example.com␠
ravi@example.com

meera@example.com

asha@example.com

(␠ marks a trailing space, typical of a column copied from a spreadsheet.) With the default settings, 3 lines are removed and the result is asha@example.com, Ravi@Example.com, a blank line, meera@example.com and the final blank line. The trailing-space copy counts as a repeat, and so does ravi@example.com, since capitals don't matter in an email address. The first spelling seen, Ravi@Example.com, is the one kept.

Choosing the switches

  • Case-sensitive on for anything where capitals carry meaning: product codes like AB-12 and ab-12, passwords or file names on Linux.
  • Ignore spaces off only when indentation matters, such as lines of code or YAML, where name: and name: are different.
  • Keep blank lines off to squash a list that has gaps in it; with it on, text separated into paragraphs keeps its breaks.

Frequently Asked Questions

Can it sort the list as well?

No; the order you pasted is kept on purpose, because the first line often matters (the newest entry, or the preferred spelling). To sort, paste the result into a spreadsheet and sort the column there.

Which occurrence gets kept when a duplicate is found?

The first occurrence is always kept, and every later repeat of that same line is removed — the output preserves the original order of first appearances rather than reordering or sorting the list.

Will it find near-duplicates, like "Asha Rao" and "Rao, Asha"?

No. Lines are compared whole, after the optional capitals and end-spaces rules, so any other difference in spelling, word order or punctuation keeps both lines. Near-duplicates need to be found by eye, for example by sorting the list first so similar entries sit together.

Related Tools

Related Blog Posts