Skip to content

Remove Duplicate Lines

Paste a list and keep only unique lines, in the original order or sorted, with a count of what was removed.

Processed locally in your browser

Options
0 chars · 0 lines
The result will appear here.

What is Remove Duplicate Lines?

Duplicate-line removal turns a list with repeats into a list of distinct entries: email lists, keyword lists, log excerpts, URLs, IDs. Each line is compared as a whole; the first (or last) occurrence is kept.

You decide how strict the comparison is: case-sensitive or not, with or without trimming spaces around each line, and whether empty lines count as duplicates. The notes tell you how many lines were removed and how many remain.

How does it work?

  1. Paste your list, one item per line.
  2. Choose case sensitivity, trimming, and whether to keep the first or the last occurrence of each duplicate.
  3. Optionally keep empty lines untouched or sort the result A → Z, then copy the unique lines.

Common use cases

  • Deduplicating a mailing list or a list of domains before import.
  • Cleaning a keyword export from an SEO tool that contains repeated phrases.
  • Reducing a log excerpt to the distinct messages.
  • Merging two lists pasted together and keeping every entry once.

Examples

Try this input in the tool above:

Input
apple
banana
Apple
cherry
banana

cherry

date
Output
apple
banana
Apple
cherry

date

Privacy

Remove Duplicate Lines runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

Lines are compared exactly (after the optional trim and case folding). "foo" and "foo." are different lines, and invisible differences such as non-breaking spaces make lines distinct.

Frequently asked questions

Which occurrence is kept?

By default the first one, so the original order is preserved. Choose "last occurrence" to keep the final copy of each line instead.

Why are two identical-looking lines not merged?

They probably differ by trailing spaces, a tab, a non-breaking space or letter case. Turn on trimming or case-insensitive mode, or clean the text first.

More tools in Text Tools →