Account

What new tool do you want?

Text & Writing

Remove Duplicate Lines

Delete repeated lines from a list and keep the first occurrence of each, with options to ignore case and blank lines.

How to use

  1. 1Paste a list with one item per line.
  2. 2Choose the matching options — duplicates are removed and the original order is kept.

Frequently asked questions

Does it keep the original order?

Yes. The first time each line appears is kept in place; later copies are removed.

Can it ignore capitalization?

Turn on 'Ignore case' and 'Apple' and 'apple' are treated as the same line.

Are leading and trailing spaces ignored?

With 'Trim spaces' on, lines are compared without surrounding whitespace, so stray spaces don't hide duplicates.

A worked example showing which occurrence survives

The list b, a, b, A, (blank), a with default settings (case-sensitive, empty lines dropped) comes back as b, a, A — keeping 3 unique lines and removing 2 duplicates. Notice the second "b" is removed but "A" survives alongside the earlier lowercase "a", because case-sensitive matching treats them as genuinely different lines. Turn on "Ignore case" with the same list and "A" now collides with the earlier "a" too, dropping to 2 unique lines — which is exactly the distinction to be deliberate about before running this on a real list, since the two settings can produce meaningfully different results on the same input.

Why order preservation is the feature, not just a side effect

The deduplication keeps each line's first occurrence in its original position rather than, say, alphabetizing the result — which matters because the order in a list is often meaningful (a chronological log, a prioritized checklist, a sequence of steps) and deduplicating shouldn't silently reorder it. Under the hood this works with a single Set tracking which normalized keys have already been seen, checked in one pass through the list from top to bottom — the first time a line is seen it's kept in place, and the Nth time only increments the "removed" counter without touching the output's order at all.

Why trim and case-insensitivity are separate toggles, not bundled together

A line like "Apple" and one like " apple " (with surrounding spaces) look identical to a human skimming a list but are byte-for-byte different strings — "Trim spaces" normalizes away leading/trailing whitespace before comparing, independently of whether "Ignore case" also normalizes letter casing. Keeping them as separate options matters because they solve genuinely different kinds of accidental duplication: trailing whitespace usually comes from copy-paste artifacts, while case variation usually comes from different people or systems entering the same real-world value inconsistently (a CSV export, user-submitted form data) — you might want to fix one without the other depending on the source.

Trim rewrites the line I keep, it does not only compare

Trim spaces starts on, and it changes what is saved, not only what is compared. A line that is apple with spaces around it is stored as apple, so the spaces are gone in the result. Remove empty lines also starts on, so blanks vanish and are not counted in Duplicates removed. They are skipped before the duplicate check. If I turn that switch off, the first blank line stays and later blank lines count as duplicates. Ignore case starts off, which is why A and a both survive until I turn it on, and the survivor is whichever I typed first, after trimming. The two counters underneath are Unique lines and Duplicates removed.

Related tools

More: Text & Writing