Remove Duplicate Lines

Paste a list and remove duplicate lines, keeping the first occurrence of each. Case-sensitive toggle and blank-line cleanup included.

Case-sensitive
Trim whitespace on each line
Remove blank lines

0 duplicate lines removed.

How it works

The tool splits your text on newlines, then walks the lines once with a JavaScript Set keeping track of what it has already seen. The first occurrence of each line is kept in its original position; later repeats are dropped. Because it's a single pass with constant-time lookups, even tens of thousands of lines dedupe instantly, and unlike the classic sort | uniq shell trick, your line order is preserved: nothing gets alphabetized as a side effect.

The options change what counts as "the same line". With case sensitivity off, each line is lowercased before the comparison (the kept line still shows its original casing). "Trim whitespace" strips leading and trailing spaces and tabs first, which matters more than you'd think: two lines can look pixel-identical on screen but differ by a trailing space or a tab, and a byte-exact comparison treats them as different. If your duplicates aren't being caught, invisible whitespace is almost always why, and trimming fixes it. Blank-line removal runs before deduping, so a lone empty line doesn't survive as "the first blank".

Processing is a few lines of JavaScript running on the text already in your tab. Nothing is uploaded: open DevTools, switch to the Network tab, and paste or edit all you want. No request ever fires, and the tool works offline once the page has loaded, which matters if you're cleaning lists that contain emails, URLs, or anything else you'd rather not send to a random server.

Common questions

Does order matter?

The first occurrence of each line is kept, later duplicates are removed. The remaining lines stay in their original order.

What counts as a duplicate with case-sensitive off?

Lines that are identical except for letter casing, "Apple" and "apple" would be treated as the same line and only the first one kept.

Is my text sent anywhere?

No, deduplication happens entirely in your browser as you type. Nothing is uploaded.