Remove Duplicate Lines

Remove duplicate lines from lists and text. Keep the first or last occurrence, ignore case and trim whitespace. Copy or download the result.

Runs in your browser
Loading Remove Duplicate Lines...

How to use

  1. 1

    Paste your list - one item per line.

  2. 2

    Set the case-sensitivity and trimming options.

  3. 3

    Click "Remove duplicates" and copy or download the result.

How it works

Each line is normalized - optionally trimmed and lowercased - then tracked in a set. Duplicate keys are dropped while you keep either the first or the last occurrence, depending on the chosen mode.

Frequently asked questions

Does it preserve the original order?

Yes, by default the first-occurrence order is kept. Toggle "keep last" if you want the final instance instead.

What counts as a line?

Each line break separates lines. Blank lines are left untouched unless you trim.

Related tools