Remove Duplicate Lines

Remove duplicate lines from any list in one paste. The unique lines appear live as you type, keeping the first copy of each and preserving the original order. Turn on ignore case or trim spaces to catch near-duplicates, then copy a clean list of emails, keywords, URLs or IDs.

Remove Duplicate Lines tool

How to use it

  1. Paste your list, one item per line.
  2. Turn on ‘Ignore case’ or ‘Sort result’ if you need them.
  3. Copy the deduplicated list.

What is a duplicate line remover?

A duplicate line remover reads a list one line at a time and keeps each line only the first time it appears. Every later copy is dropped, so you end up with unique lines in their original order.

key = line, trimmed if Trim is on, lowercased if Ignore case is on
keep the line only if its key has not been seen before

The two options define what counts as the same line. Trim spaces, on by default, ignores spaces and tabs at the ends of a line, so a value with a trailing space matches its clean twin. Ignore case merges Apple, APPLE and apple into one entry, keeping whichever spelling came first. Differences inside a line, a period, a double space, a different dash, always keep lines separate.

Worked example

Input: apple / Apple / banana / apple
Result: apple, Apple, banana

How each option removes duplicate lines

OptionsInput linesOutput
Defaults (trim on)apple, "apple ", Apple, appleapple, Apple
Ignore case onapple, Apple, APPLEapple
Trim offapple, "apple " (trailing space)Both kept, the space makes them differ
Sort result onbanana, apple, bananaapple, banana (deduped, then A to Z)
Any combinationLines with blank lines between themBlank lines are always dropped

How duplicate removal works

The tool reads your text one line at a time, remembers each line the first time it appears, and drops every later copy. Order is preserved, so the first occurrence stays exactly where it was. Blank lines are removed on the way through, which means the result is a solid list of unique values with no gaps.

Two options control what counts as the same line. ‘Trim spaces’ ignores spaces and tabs at the start and end of a line, so ‘apple ’ and ‘apple’ match; it is on by default because trailing spaces are the most common reason a list still looks duplicated after cleaning. ‘Ignore case’ makes Apple, APPLE and apple one entry, and the version kept is whichever came first.

What still counts as different

Spelling and punctuation differences are never merged. An address with a trailing period is a different line from the same address without one, and ‘New York’ is different from ‘New York City’. Spaces inside a line matter too: ‘ice cream’ with one space and ‘ice cream’ with two stay separate, so run messy lists through the remove extra spaces tool first. The tool compares whole lines only; it will not find a repeated word inside a paragraph.

Compared with spreadsheets and the command line

Excel's Remove Duplicates button on the Data tab does the same job for a column, and Google Sheets has the UNIQUE function. On the command line, sort -u sorts and dedupes in one step, while uniq on its own removes only duplicates that sit next to each other. This tool keeps your original order, offers a case switch, and needs no import step, which makes it the quicker choice for a list that arrived in an email or a document. The status line reports how many unique lines remain and how many duplicates were removed, so you can sanity-check a large list before pasting it back.

Common uses

  • Deduping email and mailing lists
  • Cleaning keyword and tag lists
  • Merging data pulled from several sources
  • Preparing unique values for a spreadsheet
  • Removing repeated URLs from a crawl or export
  • Cleaning copied lists of names, SKUs or IDs

When to use it

  • You need to remove duplicate emails from a mailing list before an export goes out twice to the same person.
  • A keyword list for an ad campaign grew from several sources and half the terms repeat.
  • A crawler export is full of repeated URLs and you want each page listed once.
  • You want to remove duplicate lines from a pasted column without opening Excel or writing a formula.
  • Two copied name lists need merging into one list with no repeats.

Related tools

Sort Lines offers more orderings than the built-in A to Z switch, including numeric and by-length sorting after you dedupe.

Remove Extra Spaces fixes double spaces inside lines, the usual reason two identical-looking entries refuse to merge.

Remove Line Breaks turns the finished unique list into a single comma-separated line for a To field or a tag box.

Frequently asked questions

It keeps the first occurrence of each line and removes the ones below it, so the original order is preserved. If you need the last copy instead, reverse the lines with the reverse text tool, remove the duplicates, then reverse the result again.
Yes. Turn on ‘Ignore case’ so that lines differing only in case are treated as duplicates. The first spelling that appears is the one kept, so if the list starts with ‘Apple’ and later has ‘apple’, the output shows ‘Apple’.
Optionally. Check ‘Sort result A→Z’ to alphabetize the unique lines using dictionary order. Leave it off to keep the lines in the order they first appeared, which is usually what you want for a list that has a meaning to its order, such as steps or rankings.
Yes, always. Empty lines and lines that contain only spaces are dropped so the output is a solid list. If you need blank lines back, for example between groups, add them after deduplicating.
They probably differ in something you cannot see: a trailing period, a double space inside the line, a tab, or a different apostrophe or dash character. Turn on ‘Trim spaces’ and ‘Ignore case’, run the list through the remove extra spaces tool, and try again.
In Excel, select the column and choose Data, Remove Duplicates. In Google Sheets, type =UNIQUE(A:A) in an empty column. Both are quick for data already in a sheet, but for a list pasted from a document or email this tool is faster because there is no import step.
No fixed limit. Everything runs in your browser, so tens of thousands of lines process almost instantly, and the only ceiling is your browser's memory. Nothing is uploaded, which also makes it safe for customer lists and other data you would rather not send to a server.