Remove duplicate lines

Keeps the first occurrence of every line and preserves the original order.

Paste a list — emails, keywords, URLs, anything one per line — and duplicates disappear. Comparison ignores leading and trailing spaces.

Try:
0Words
0Characters
0No spaces
0Sentences
0Paragraphs
0Lines
0Pages
0Reading
0Speaking

Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.

How to use it

  1. Paste your list, one item per line.
  2. Press Remove duplicates.
  3. Optionally sort the result, then press Copy.

What this tool does

Every line of the pasted text is compared with the lines before it. The first time a line appears it is kept in place; every later repeat is dropped. The order of what remains is exactly the order you pasted, which is what you want when the list is ranked or chronological.

Details that decide the result:

Examples

InputOutputWhy
red
blue
red
green
red
blue
green
The second red is dropped; the first keeps its position.
Apple
apple
Apple
apple
Case sensitive, so both stay.
  mail@x.com
mail@x.com  
mail@x.comSurrounding spaces are ignored before comparing.
a
b
a
b
a
a
b
Only the first occurrence of each survives.

Combining buttons covers most real cleanups. Remove duplicates then Sort A→Z gives a unique alphabetical list — the equivalent of sort -u on the command line. Sorting first and deduplicating second gives the same set, just discovered in a different order.

When you need it

A useful habit before deduplicating: normalise the list first. Mixed capitalisation, stray trailing spaces and inconsistent internal spacing all create duplicates that no exact-match comparison can see. Lowercase the list with the case converter, run the text cleaner, then deduplicate. On a merged export of a few thousand email addresses that order routinely removes two or three times as many rows as deduplicating the raw file does.

What the tool cannot catch is a duplicate that is genuinely written differently: bob@example.com and bob+news@example.com reach the same inbox but are different strings, and example.com/page and example.com/page/ are the same page with different text. Those need a rule of their own before the comparison runs.

Doing it without this tool

Every major program can do this; the menu paths are just easy to forget.

Excel

  1. Select the column or range.
  2. Data → Data Tools → Remove Duplicates.
  3. Tick My data has headers if row 1 is a header, choose which columns define a duplicate, press OK. Excel reports how many rows it removed.

To keep the original and get a unique copy instead, use Data → Advanced → Copy to another location with Unique records only ticked. In Microsoft 365, =UNIQUE(A2:A500) produces a live list that updates itself. To find duplicates without deleting anything, use Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values.

Google Sheets

  1. Select the range.
  2. Data → Data cleanup → Remove duplicates.
  3. Confirm which columns to analyse and press Remove duplicates.

Or leave the source untouched and put =UNIQUE(A2:A) in an empty column.

Notepad++

Command line

Privacy: your text never leaves your browser

Deduplication runs in JavaScript on your device. The list is never uploaded, never logged and never stored; reloading the page clears it.

This is the one tool where privacy is nearly always relevant, because the lists people deduplicate are email addresses, customer records and internal URLs. Pasting a subscriber list into a server-side tool is a data transfer that may need a contract behind it; pasting it here is not, because nothing leaves the tab.

Related tools

Sort by lengthOrders lines by how many characters they contain, shortest or longest first.Remove empty linesDeletes blank lines — or collapses runs of them down to one.Sort linesAlphabetical or reverse sorting for any list, with natural number order.Remove punctuationStrips punctuation and symbols, optionally keeping apostrophes and hyphens.Title case vs sentence caseThree style guides, three different answers, and the four-letter rule that…Instagram caption lengthThe hard limit is 2,200 characters. The one that matters is the 125 you see…Upside down textFlip a line so it reads the other way up. Copy and paste anywhere.

See all text tools →

Frequently asked questions

Is the original order kept?

Yes. The first time a line appears it stays where it was, and later repeats are dropped. Sort afterwards if you also want alphabetical order.

Is the comparison case sensitive?

Yes. Apple and apple are treated as different lines. Convert the case first if you want them merged into one.

Are blank lines removed?

No, blank lines are left alone so paragraph spacing survives. Use the text cleaner if you want runs of blank lines collapsed.

How do I remove duplicates in Excel?

Select the range, then Data, Data Tools, Remove Duplicates. Tick "My data has headers" if row 1 is a header, and Excel reports how many rows it removed.

How do I do it in Google Sheets?

Select the range and choose Data, Data cleanup, Remove duplicates. To keep the original list intact, put =UNIQUE(A2:A) in an empty column instead.

Does trailing whitespace break the comparison?

No. Leading and trailing spaces are trimmed before lines are compared, so a stray space at the end of a pasted line does not create a false unique.

Can I see which lines were duplicated?

Not directly, but the line counter under the box shows the before and after totals, so the difference tells you how many repeats were removed.