Remove duplicate lines
Deduplicate a list of keywords, emails or URLs, with blank lines and case handled.
Result
Before you ship this
- Note: Paste the lines to work through.
How to use it
- Paste the list, one item per line.
- Choose what to keep: one of each, only the items that appear once, or only the repeats.
- Leave case insensitive unless capitals genuinely distinguish two items.
- Sort if you need to, then copy.
Invisible differences
Most deduplication failures are whitespace. A list exported from a spreadsheet or copied out of an email arrives with trailing spaces, and two lines that look identical are not.
Every line here is trimmed before comparison and kept as typed afterwards, so the output is clean without silently rewriting your data.
Case is usually noise
For keywords and email addresses, Apple and apple are the same item, which is why case is ignored by default and the first spelling wins.
For anything case-sensitive — identifiers, passwords, file paths on a Unix system — turn it on, because there the difference is real.
Three questions, not one
"One of each" cleans a list. "Only lines that appear once" finds what is unique to it. "Only lines that repeat" finds the overlap.
The third is the one people reach for when comparing two keyword lists or checking a mailing list against a suppression file.
Why duplicates survive a dedupe
Two lines are only duplicates if they match exactly. A trailing space, a capital letter or a smart quote pasted from a document makes them different strings, so the list comes back with what looks like the same entry twice.
Trim and lowercase the list first when you are deduplicating emails, keywords or URLs — those are the three where near-duplicates matter most and are hardest to spot by eye.
Remove duplicate lines FAQ
Why do two identical-looking lines survive deduplication elsewhere?
Trailing whitespace. A line ending in a space is a different string, and you cannot see it. This tool trims every line before comparing, which is why it catches them.
Can I find the duplicates rather than remove them?
Yes — choose only lines that repeat. It lists each repeated item once, which is what you want when auditing a keyword list or a mailing list for overlap.
Is the order preserved?
Yes by default: the first occurrence of each line keeps its position. Sorting A to Z or Z to A is optional.
Does this handle Windows and Unix line endings?
Yes. Carriage returns are stripped before comparing, so a list pasted from a Windows text editor deduplicates against one pasted from a Mac. This is the second most common reason two identical lines both survive elsewhere.
What about invisible Unicode characters?
Ordinary spaces and tabs are trimmed. A non-breaking space or a zero-width character pasted in from a word processor or a web page is not whitespace as far as most code is concerned, and will keep two lines apart. If a pair that looks identical still survives, that is usually why.
Will it treat a URL with a trailing slash as a duplicate?
No. They are different strings, and for URLs they can genuinely be different pages. Normalise the list first if you want them merged — find and replace is enough — because guessing which URLs are equivalent is not something a text tool should decide for you.
Is case-insensitive matching safe for email addresses?
In practice yes. The domain half is definitively case-insensitive, and while the local part is technically allowed to be case-sensitive, no mail provider anyone uses treats it that way. Deduplicating addresses case-insensitively is the right default.
How large a list can it handle?
Tens of thousands of lines without trouble, since the work happens in your browser rather than on a server. The practical limit is how much text you can paste comfortably, not the deduplication itself.
Is my list uploaded anywhere?
No. Everything runs in the page, nothing is sent, and nothing is stored. That matters for the usual contents of a list like this: customer email addresses, internal URLs, keyword lists you would rather not share.
Can I deduplicate a comma-separated list?
Convert it to one item per line first — a find and replace of the comma with a line break does it. The tool works line by line, which keeps the behaviour predictable when the items themselves contain commas.