Back to Developer
Line dedupe — keep unique or extract duplicates

Line dedupe — keep unique or extract duplicates

Split the input by newline and remove duplicate lines, keeping only the first occurrence of each line in original order. Catches non-adjacent duplicates as well (equivalent to `awk '!seen[$0]++'`). Runs entirely in your browser.

developertext

How to use

Paste lines (one entry per line), choose Case-sensitive (default) or Case-insensitive, and click Remove duplicates. We split on \n / \r\n and keep only the first occurrence of each line, preserving original order. This matches Unix `awk '!seen[$0]++'`. Non-adjacent duplicates are removed too. In case-insensitive mode, 'Apple' and 'apple' are treated as the same line and the first occurrence is kept verbatim. Copy the result or download as .txt with one click.

FAQ

Is text uploaded?
No. Set-based deduplication runs entirely in your browser — input and output never leave the device.
Is the comparison case-sensitive?
By default yes — 'Apple' and 'apple' are kept as distinct lines. Switch Case sensitivity to Case-insensitive to merge them; the first occurrence (e.g. 'Apple') is preserved verbatim, while later 'apple' / 'APPLE' entries are dropped as duplicates.
Is whitespace trimmed?
No. 'foo' and ' foo' (with a leading space) are kept as distinct lines.
Does it dedupe non-adjacent duplicates?
Yes. Unlike Unix `uniq` (which only collapses adjacent duplicates), this tool behaves like `awk '!seen[$0]++'`, removing duplicates anywhere in the input.
How are blank lines handled?
Blank lines are treated as a line in their own right — repeated blank lines after the first are removed.
In case-insensitive mode, is the output lowercased?
No. Only the comparison key is lowercased; the output preserves the original casing of the first occurrence. For input 'Apple\napple', only 'Apple' (the first occurrence) is kept.

Related tools