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)
- 1Paste your list into the input panel
- 2Toggle Case sensitive to match only exact-case duplicates (default: off)
- 3Toggle Trim to ignore whitespace differences when comparing (default: on)
- 4Output keeps the first occurrence of each value, in the order it first appeared
- 5For alphabetical output instead, use Sort then this tool, or Find unique items
Keyboard shortcuts
Drive ListShift without touching the mouse.
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.
Apples bananas apples Oranges BANANAS Apples
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 |