Skip to content
1001 Tools
sr
Text tools

Remove Duplicate Lines

Paste any list — emails, URLs, product codes, log lines — and every repeated line disappears, keeping the first occurrence in its original position. The counter tells you exactly how many duplicates were removed, and two switches control how strictly “duplicate” is defined.

Unique lines

How it works

Each line is checked against everything seen above it; repeats are dropped, originals stay in place. Order is never changed — if you also want the list sorted, run it through the Sort Lines tool afterwards (sorting first also works, and groups near-duplicates for review).

By default, comparison ignores leading and trailing whitespace, because “item” and “item ” are almost always meant to be the same entry — the visible output still keeps your original line as typed. Turn that off for data where edge whitespace is meaningful.

Case-insensitive matching treats “Beograd”, “beograd” and “BEOGRAD” as one entry, keeping whichever came first. It is off by default since codes and identifiers are often case-sensitive.

Practical examples

Merging two mailing lists

Paste both lists one after the other, enable case-insensitive matching (emails are case-insensitive in practice), and the result is a clean union — 412 lines in, 371 out, 41 duplicates reported.

Cleaning exported keywords

Keyword exports from several campaigns overlap heavily. Deduplicate before analysis so frequency counts aren’t inflated by the same phrase appearing five times.

A shopping list assembled by the whole family

Three people added “milk”. Paste, deduplicate, send back to the group — the trim option catches the version someone typed with a stray space.

Log lines before diffing

Repeated status messages drown the interesting lines in a log excerpt. Deduplicate first, then compare with the Text Difference Checker to see what actually changed.

Frequently asked questions

Which occurrence of a duplicate is kept?

The first one, in its original position. Everything after it that matches is removed. This keeps your list stable: the surviving lines are exactly the ones you saw first, in the order you had them.

Does the output keep my original formatting?

Yes. Even when “ignore surrounding whitespace” is on, that setting only affects comparison — the kept lines appear exactly as you typed them, spaces and all.

Are empty lines deduplicated too?

Yes — the first empty line survives and later ones are removed, like any other duplicate. If you want all blank lines gone, the Remove Extra Spaces tool has a dedicated option.

Is “Čačak” the same as “Cacak” for matching purposes?

No. Diacritics make characters distinct — č is not c. Only letter case is normalized (when you enable it), never the letters themselves. To unify transliterations, convert them first.

Can I remove duplicates AND sort the result?

Chain the tools: deduplicate here, copy, then paste into Sort Lines Alphabetically (linked below). Keeping the operations separate means each page does its one job predictably.

How many lines can it handle?

Hundreds of thousands. The algorithm makes a single pass with a hash set, so a 200 000-line paste deduplicates in well under a second.

Why did fewer duplicates get removed than I expected?

Usually invisible differences: non-breaking spaces, trailing tabs or Windows carriage returns make lines technically different. Enable both comparison options, or run the text through Remove Extra Spaces first.

Is my list uploaded anywhere?

No. Deduplication happens in your browser — customer emails and internal data never leave your machine.

Related tools