Remove duplicate lines from text

Remove duplicate lines while keeping the first occurrence. Optionally ignore case or leading and trailing whitespace.

Your inputs stay herePUFFINMINT

Set your data

Set your data

Paste one item per line, choose comparison options and download a clean TXT list in its original order.

Result

The result updates as you type.

The values you enter stay on this page. Reloading or closing it clears them.

We count which tools are used most, without including entered values or file contents in the statistics. Privacy

How to use the tool

  1. Choose whether to ignore case or spaces at the ends of lines. Open Compare versions to see struck-through duplicates in the original and the retained lines in the result.

Method and principles

A set of comparison keys identifies duplicates.

Ignoring outer whitespace does not alter the retained line’s actual text.

Practical example

Three lines apple, pear and apple become apple and pear. Ignoring case makes Apple and apple equivalent.

Input
  • Original text: A B A
  • Ignore letter case: No
  • Ignore leading and trailing whitespace for comparison: No
Result
A B

Options and limits

The first matching line is kept exactly. Blank lines can also be duplicates, so at most one is retained. Accents remain significant.

Example details

Example details
ParameterValue
Characters including whitespace3

Limits and checks

Limits and checks
ParameterValue
Original text≤ 100000 characters

Frequently asked questions

Do the retained lines change order?

They stay in the order of their first occurrence. You can sort them separately if you need an alphabetical list.

Favorites