Remove Duplicate Lines

Paste a list or any text with one item per line, and this tool removes every line that repeats an earlier one. The first copy of each line stays where it was, so the order of your list does not change. Choose whether capital letters and stray spaces count as differences, then copy or download the cleaned list. Everything runs in your browser; your text is never uploaded.

Inputs

Result

Text without duplicates
apples
bananas
Apples
cherries
dates
Lines before
7
Lines after
5
Duplicate lines removed
2

How it is calculated

  1. Text without duplicates: start from the text or list (one item per line), then convert Windows and old Mac line endings to standard line breaks, then keep the first copy of each line, ignoring spaces at the ends
  2. Lines before: start from the text or list (one item per line), then convert Windows and old Mac line endings to standard line breaks, then count lines
  3. Lines after: start from the text without duplicates, then count lines
  4. Duplicate lines removed = lines before − lines after

Resources for your next step

Helpful downloads

View all text & lists downloads
Store coming soon

We are preparing practical spreadsheets, planners, and guides. Explore the store page for what is next.

How duplicate lines are found

The tool reads your text line by line from top to bottom. The first time it sees a line, it keeps it and remembers it. Any later line that matches a remembered line is dropped. Because only later copies are removed, the surviving lines stay in their original order, which matters for ranked lists, schedules and anything you have already sorted by hand.

With the example list, apples, bananas and cherries each appear twice. Spaces at the ends are ignored by default, so the indented cherries line counts as a repeat, and the cleaned list keeps apples, bananas, Apples, cherries and dates. That is 7 lines before, 5 lines after and 2 duplicates removed.

Capital letters and spaces

Turn on the capital letters option when Apples and apples should count as the same item, for example in a list of names typed by different people. The comparison then ignores case, but the line that stays is shown exactly as you typed its first copy, with its original capitals.

Leading and trailing spaces are easy to miss after copying from a spreadsheet or a web page. With the spaces option on, two lines that differ only in spaces at their ends match, and the first copy is kept unchanged. Spaces inside a line always count, so “ice cream” and “ice cream” stay different; the remove extra spaces tool can tidy those first.

Line endings and blank lines

Text copied from Windows programs ends its lines with a carriage return and a line feed, while most other systems use a line feed alone. The tool converts every line ending to a standard line break before comparing, so the same item from different sources is still recognized as a repeat.

Blank lines are treated like any other line: the first blank line stays and later blank lines are removed. If you want no blank lines at all, run the remove empty lines tool on the result. The counts show lines exactly as they are split by line breaks, so a list with one item per line gives a count equal to its number of items.

Good uses and limits

Common uses include cleaning email lists before an import, removing repeated keywords, tidying exported records, merging two lists that overlap and checking a list for accidental repeats. The removed count tells you at a glance whether a list had duplicates at all.

The tool compares whole lines only. It does not find repeated words inside a sentence or near-duplicates with different spelling, and it does not sort the list. For very large lists the work still happens on your device; up to 200,000 characters can be pasted at once.

Frequently asked questions

Which copy of a duplicate line is kept?

The first one. Later copies are removed and the remaining lines keep their original order.

Does it sort my list?

No. The order stays as you pasted it, minus the repeated lines.

Can it ignore capital letters?

Yes. Turn on the option to treat capital and lowercase letters as the same. The kept line still shows its original capitals.

Why are two lines that look the same both kept?

They differ somewhere, often by a space inside the line or a look-alike character. Turn on the spaces option for differences at the ends, or tidy spaces first with the remove extra spaces tool.

Is my text uploaded?

No. The text is processed in your browser and is not sent to a server or saved.

How much text can I paste?

Up to 200,000 characters, which is roughly 30,000 to 40,000 words.

Sources

Text is processed in your browser and never sent anywhere. Check the result before you replace your original.

All text & lists tools