● processed entirely in your browser

Duplicate line remover

Paste a list below — remove duplicate lines, trim whitespace, and optionally sort. Nothing is sent anywhere.

How it works

The text is split into lines, optionally trimmed and stripped of empty lines, then walked in order while a Set tracks which line (or, with Ignore case on, its lowercased form) has already been seen — only the first occurrence of each unique line is kept, and the result is sorted afterward if you've asked for that.

FAQ

Which duplicate copy does it keep — the first or the last?
The first occurrence of each line is kept. With Ignore case on, "Banana" and "banana" are treated as the same line, but whichever spelling appeared first in your original list is the one that survives in the output.
Does sorting happen before or after duplicates are removed?
After — duplicates are removed first, in original input order, using a Set to track lines already seen. Only if Sort alphabetically is checked does the tool then sort the deduplicated list, using locale-aware comparison rather than raw character-code order.

Free, unlimited, no account. If this saved you a paid tool, a small thanks is appreciated.

Say thanks — $3