All toolsMenu: every tool
Daytoolz

Duplicate Line Remover

Remove repeated lines from a list, keep only the repeats, or keep only what appears once.

Duplicate Line Remover

Result

apple banana cherry date

  • Lines you pasted6
  • Lines left4
  • Duplicates removed2

Works out in your browser. Nothing you type is sent anywhere.

In short: Duplicate Line Remover

The list went in with 6 lines and came back with 4, so 2 repeats were taken out, leaving 4 distinct lines in all. The other two modes do the opposite jobs: keeping only the lines that repeated, or only the ones that appeared exactly once.

What is Duplicate Line?

Removing duplicate lines keeps one copy of each distinct line and drops the rest, optionally ignoring case and the spaces at the ends.

How is Duplicate Line calculated?

out=first occurrence of each distinct line

Each line is compared with the ones before it, optionally ignoring case and the spaces at either end, and only the first of each set is kept. Counting every line first is what lets the other two modes pick out the repeats or the singletons.

  • outthe lines that are kept
  • distinct linea line not seen before under the comparison rules chosen

A worked example

Inputs and results for the worked example
Your listapple banana apple cherry banana date
Treat upper and lower case as the sameYes
Ignore spaces at the endsYes
Sort the resultKeep the original order
KeepOne of each line
Result
Resultapple banana cherry date
Lines you pasted6
Lines left4
Duplicates removed2

Every figure in this table is produced by the same calculation the tool above runs.

How to use this duplicate line remover

  1. Paste the list, one item to a line.
  2. Choose whether case and the spaces at the ends should matter.
  3. Choose what to keep: one of each, only the repeats, or only the singletons.
  4. Sort the result if the original order does not matter.

Questions people ask

Does the original order survive?

Yes, unless you ask for sorting. The first occurrence of each line keeps its place, which matters when the order carries meaning. Sorting is there for when it does not.

Why ignore the spaces at the ends?

Because a list pasted from a spreadsheet or a document often has trailing spaces that are invisible but make two identical-looking lines differ. Trimming makes the comparison match what you can see. Turn it off if the spacing is meaningful.

What does keeping only the duplicates do?

It returns one copy of each line that appeared more than once, which is how you find out what is repeated rather than removing it. The opposite mode returns only the lines that appeared exactly once. Both are useful for comparing two lists pasted together.

Is there a limit on how long the list can be?

Only your device's memory, because everything is held in the page. Lists of tens of thousands of lines are no trouble on a modern phone. Nothing is uploaded whatever the size.

Accuracy and sources

Checked by the Daytoolz team on 16 October 2026. How we check our tools.

All text & writing tools