<link rel="stylesheet" type="text/css" href="/mirawhite.css">

Remove duplicate lines

Paste a list or the content of a text file, one item per line. Duplicates are removed as you type and the first occurrence of each line stays in place. Free, with no sign-up.

Free, no sign-up, no limit Runs in your browser: your text and files are never sent or saved.

Remove duplicate lines

Options
Keep

How to use it

  1. Paste your list in the box, one item per line (from Excel, a .txt file, an email…).
  2. Choose whether "Apple" and "apple" count as the same line.
  3. Copy the cleaned list or download it as a .txt file.

Example

Input

anna@example.com
ben@example.com
Anna@example.com
anna@example.com
chloe@example.com
ben@example.com

Output

anna@example.com
ben@example.com
Anna@example.com
chloe@example.com

Good to know

  • Lines are compared whole: "Paris, France" and "Paris" are different lines.
  • Spaces at the start and end of a line are ignored by default; untick the option to keep them.
  • Ignoring accents treats "café" and "cafe" as the same line; the first spelling is kept.
  • "Only lines without duplicates" drops every copy of a repeated line; "Only duplicated lines" lists each repeated line once, to see what was repeated.

Frequently asked questions

How do I remove duplicate lines from a text file?

Open the file, copy everything (Ctrl+A, Ctrl+C) and paste it here: each line is compared with the ones above it and repeats are dropped. Then click “Download” to get a clean .txt file, or copy the result back into your file.

How do I remove duplicate lines in Excel without changing the order?

Copy the column, paste it here, then copy the result and paste it back into Excel: the first occurrence of each value stays where it was. Inside Excel, Data > Remove Duplicates does the same on a selected range of cells.

Which copy is kept: the first or the last?

The first one. Every later line identical to a line already seen is removed, and the remaining lines keep their original order: nothing is sorted. To sort the list as well, run it through “Sort lines alphabetically” afterwards.

Are “Apple” and “apple” treated as duplicates?

Not by default: lines must match exactly, capitals included. Tick “Ignore case” to merge them, and “Ignore accents” to treat “café” and “cafe” as one line. Spaces at the start and end of a line are ignored by default, so “apple ” and “apple” already count as the same.

How do I remove duplicate lines on Linux?

In a terminal, awk '!seen[$0]++' file.txt keeps the first occurrence in the original order, while sort -u file.txt sorts the lines and drops repeats. Without a terminal, paste the file content on this page and download the result.

Is my list sent to a server?

No. The comparison runs in your browser as you type, so email addresses, names or customer lists never leave your device. The tool is free, needs no account and has no line limit other than your browser’s memory.

← Back to all tools