Skip to main content

Remove Duplicate Lines

Email lists with the same address three times, keyword lists, inventories, log files, survey answers — duplicates creep into every line-based list. Paste the list, choose how strict the comparison should be, and get back each line exactly once, with a count of what was removed.

Your list is processed entirely in your browser — an email list you paste here is never uploaded anywhere.

“Apple” and “apple” count as the same line.

Lines that differ only in surrounding spaces count as duplicates.

Drop empty lines entirely instead of keeping the first one.

Order of the result

Lines in

5

Unique lines kept

3

Duplicates removed

2

Processed entirely in your browser — your list never leaves this page.

Embed this calculator on your website →

The formula

keep the first line with each comparison key · key = line (optionally trimmed, optionally lowercased)

  • keep first — the first occurrence of each line survives, in its original position and original spelling; later duplicates are removed.
  • trim when comparing — on by default: “ apple” and “apple ” count as the same line, though the surviving copy keeps its original spacing.
  • blank lines — by default the first blank line is kept like any other line; the toggle removes blanks entirely.

Worked example: apple / banana / apple / cherry / banana (5 lines) → apple / banana / cherry — 3 unique lines, 2 duplicates removed.

How it works

The tool walks your text line by line. Each line gets a comparison key — the line itself, trimmed if you chose trimming, lowercased if you chose case-insensitive comparison. The first time a key appears, the line is kept; every later line with the same key is counted as a duplicate and dropped. Sorting, if chosen, is applied to the survivors at the end.

Because the surviving line is the first occurrence exactly as written, deduplicating never silently rewrites your data — if “Apple” appeared before “apple”, “Apple” is what you keep.

Examples

  • The sample list → apple, banana, apple, cherry, banana becomes apple, banana, cherry: 5 lines in, 3 kept, 2 removed.
  • Case variants → Apple, apple, APPLE with “ignore case” on becomes a single Apple (the first spelling wins).
  • A messy paste → lines that differ only by stray spaces count as duplicates with trimming on, so a list pasted from a spreadsheet cleans up in one pass.

Frequently asked questions

What counts as a duplicate?

Lines whose comparison keys match. By default the key is the line with surrounding spaces trimmed; turn on 'ignore case' to also fold letter case. Turn trimming off if trailing spaces are meaningful in your data (rare, but real — some fixed-width formats).

Does it change the lines it keeps?

No. Kept lines are byte-for-byte the first occurrences from your original text, in the original order (unless you ask for A–Z sorting). Comparison options affect only what counts as a duplicate, never the surviving text.

Is there a size limit?

The practical limit is your device's memory — lists of hundreds of thousands of lines process fine in a modern browser. Because everything runs locally, a huge list never travels over the network either.

Is my list uploaded?

No. The deduplication runs entirely in your browser. That is a deliberate design choice: lists are exactly the kind of data that should not be pasted into a stranger's server.