Remove Duplicate Lines – Delete Repeated Lines From Any List

Paste a list, one item per line, and every repeated line is removed as you type, leaving each line once.

Options
0
Lines in
0
Different lines
0
Lines removed
0
Lines repeated

Choose whether "Apple" and "apple" count as the same, whether spaces at the ends matter, what to do with blank lines, and whether to keep the first or the last copy. You can also sort the result A to Z or naturally (file 2 before file 10), show only the lines that were repeated, and put a count in front of each line. It handles lists of 100,000 lines and more in a blink, and you can copy the result or download it as a .txt file. Nothing is uploaded.

How it works

The list is split at each line break (Windows, Mac and Linux line endings all work). Each line is turned into a comparison key: with "Ignore spaces at the start and end" on, leading and trailing spaces and tabs are removed; with case-sensitivity off, the key is lowered using the page language's rules. The key is also normalized to Unicode NFC, so an é typed as one character and an é typed as e plus an accent count as the same line. Then the tool walks through the list once, keeping a table of the keys it has already seen and how many times. That is why 100,000 lines take a fraction of a second: each line is looked up once instead of being compared with every other line. With "The first one", a line stays where it first appeared and later copies are dropped; with "The last one", it moves to where it last appeared, written the way it was written there. Blank lines are left in place by default and never count as duplicates, so paragraphs keep their spacing. You can remove them all or treat them like any other line. "Only lines that were repeated" lists each line that appeared more than once, a quick way to find the duplicates rather than delete them, and "Only lines that appear once" does the opposite. Sorting uses your language's alphabetical order (Intl.Collator), so accented letters sort next to their base letter instead of after Z. Natural order compares numbers by their value, so "item 2" comes before "item 10".

Worked example

A mailing list of 7 lines: anna@example.com, ben@example.com, Anna@example.com, carla@example.com, "ben@example.com " with a trailing space, dave@example.com and anna@example.com again. With the default settings (case-sensitive, spaces at the ends ignored) the tool keeps 5 lines and removes 2: the second anna@example.com, and the ben@example.com with the stray space, which matches once the space is ignored. Anna@example.com stays, because a capital A makes it a different line. Email addresses don't care about case, so untick "Case-sensitive": now 4 lines remain (anna@example.com, ben@example.com, carla@example.com, dave@example.com), 3 are removed, and the counter shows 2 lines that were repeated.

Built and maintained by Miguel Marcos · Updated

Frequently asked questions

How do I remove duplicate lines in a list?

Paste the list into the box. Duplicates are removed at once and the result appears below, ready to copy or download. Change the options and the result updates.

Does it keep the original order?

Yes. Each line stays where it first appeared, unless you choose to keep the last copy or to sort the result.

Can I see which lines were duplicated instead of deleting them?

Yes. Under "Show", choose "Only lines that were repeated", and tick "Show how many times each line appeared" to see how often each one came up.

What is natural sort?

Sorting that reads numbers as numbers: photo 2, photo 10, photo 20 instead of the plain alphabetical photo 10, photo 2, photo 20.

How many lines can it handle?

Hundreds of thousands. A list of 150,000 lines is processed in well under a second on a normal laptop, because each line is checked once against a lookup table.

Is my list uploaded?

No. Everything runs in your browser and the list never leaves your device. Only the options are kept in the page address, so a link opens with the same settings.