Dedupe a list (keeping order)

Paste a list and get it back with duplicate items dropped - only the first occurrence of each value survives. Original order is preserved (unlike sort+dedupe, which reorders everything alphabetically). Comparison is case-insensitive by default with whitespace trimmed.

Input
Ready
Output
Live

First-occurrence-wins deduplication

The tool walks the list in order, keeping a Set of already-seen keys. When a new item produces a key not in the Set, it is kept and added; when it produces a key already in the Set, it is dropped. Order of what is kept matches the order the items first appeared - no re-sorting happens.

Case sensitive (off by default) controls how the key is built. Off means `Apples`, `apples`, and `APPLES` all produce the same key and only the first one survives. On means each case variant is its own distinct item. Pick off for most cleanup tasks; on when case matters (e.g. case-distinct IDs).

Trim (on by default) strips whitespace from each item before the key compare - so `Apple` and ` Apple ` dedupe as the same value. The first-occurrence item is kept with its original whitespace intact; the later copies are dropped regardless of their whitespace. Turn Trim off to treat whitespace-different duplicates as distinct.

How to use dedupe a list (keeping order)

  1. 1Paste your list into the input panel
  2. 2Toggle Case sensitive to match only exact-case duplicates (default: off)
  3. 3Toggle Trim to ignore whitespace differences when comparing (default: on)
  4. 4Output keeps the first occurrence of each value, in the order it first appeared
  5. 5For alphabetical output instead, use Sort then this tool, or Find unique items

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What this deduper actually does

First-occurrence-wins with two comparison options.

Preserves original order

Items keep their position from the input - no sort, no shuffle. The first time each unique value appears is where it lands in the output.

Case-insensitive comparison by default

With Case sensitive off, `Apple` and `apple` are treated as the same item. Only the first occurrence (with its original case) is kept. Toggle on to dedupe strictly.

Trim-aware comparison by default

With Trim on, items are compared after stripping leading/trailing whitespace. `Apple` and ` Apple ` collapse to one entry. The first-occurrence item keeps its original whitespace in the output.

Set-based O(n) algorithm

Uses a JavaScript `Set` keyed on the normalised value. Lookup is amortized O(1) so total cost is linear in the list length - the tool comfortably handles lists well beyond what you can paste into a textarea in one go.

Blank and whitespace-only lines pass through

Blank lines are not special-cased - if you have two blank lines, the first is kept, the second is dropped (they normalise to the same empty key). Drop them first with Remove empty items if that is what you want.

Worked example

Default case-insensitive compare: `Apples`, `apples`, `APPLES` all collapse to the first occurrence.

Input
Apples
bananas
apples
Oranges
BANANAS
Apples
Output
Apples
bananas
Oranges

Settings reference

How each option shapes the deduped output.

Setting What it does Effect on the sample
Case sensitive: off (default) Treats case variants as the same item `Apples`, `bananas`, `Oranges` (3 items out of 6)
Case sensitive: on Distinguishes `Apples` from `apples` from `APPLES` `Apples`, `bananas`, `apples`, `Oranges`, `BANANAS` (5 items)
Trim: on (default) Compares after stripping leading/trailing whitespace No visible change on the sample (no extra spaces)
Trim: off Exact whitespace match required for a duplicate `Apples` and ` Apples ` would appear as separate items

FAQ

What is the difference between this and Sort + Dedupe?
This tool keeps items in their original input order - the first occurrence wins, later copies drop out. Sort then dedupe produces an alphabetical list instead. Use this one when order matters (event logs, priority lists); use sort+dedupe when you just want a unique set.
Which copy of a duplicate is kept?
The first one. If your input has `Apple` then ` apple ` then `APPLE`, the output has just `Apple` (with its original casing and whitespace). Later copies are dropped regardless of their formatting differences.
Does turning off Trim change which item is kept?
No - it only changes the comparison. With Trim off, `Apple` and ` Apple ` are treated as distinct items and both are kept. With Trim on, only the first one is kept (its original whitespace preserved).
How are blank lines handled?
As items. Two blank lines produce the same key (empty string after trim), so the second is dropped. To remove all blanks entirely, chain Remove empty items.
What is the opposite of this?
Finding duplicates - Find duplicates keeps only items that appear more than once. Find unique items keeps only items that appear exactly once.