Remove Duplicate Lines

Remove duplicate lines from a list with options to ignore case, trim spaces and drop empty lines. Shows lines in, out and removed. Free.

Input
Result

About Remove Duplicate Lines

Remove Duplicate Lines cleans up any list by keeping the first copy of each line and deleting the repeats. It shows how many lines went in, came out and were removed.

Ignore case

Treats Apple and apple as the same; ideal for names and email addresses typed in different ways.

Trim spaces

Ignores spaces at the start and end of lines, common in lists copied from documents.

Drop empty lines

Removes blank lines too.

Whole lines only

Apple and Apple pie are different lines. The first copy stays in its place and the order is kept.

Good for

Mailing lists, keyword lists, URL lists and log files.

Private

Your text stays in your browser. Nothing is uploaded.

Example

Input: apple, banana, apple, cherry, banana. Output: apple, banana, cherry, with 2 duplicates removed.

How to use Remove Duplicate Lines

  1. Paste your list, one item per line, or open a text file.
  2. Tick Ignore case, Trim spaces or Remove empty lines as needed.
  3. Read the result and the counts of lines in, out and removed.
  4. Copy the result or download it.

Related guide: How to Remove Duplicate Lines Without Losing Order

Help & FAQ

What does Remove Duplicate Lines do?

It deletes repeated lines from a list and keeps the first copy of each one, in the original order.

Which copy is kept?

The first. With Ignore case on, Apple and apple count as the same and the first spelling, Apple, is kept.

What does Trim spaces do?

It ignores spaces at the start and end of each line when comparing. In the test a padded Apple counted as a copy of Apple.

What does Remove empty lines do?

It deletes blank lines from the result. Without it, one blank line is kept and repeats are removed.

Which options are on by default?

Trim spaces is on. Ignore case and Remove empty lines are off.

Does it sort the lines?

No. The order of first appearance is kept. Use the Text Sorter to sort.

Are Apple and Apple pie duplicates?

No. Whole lines are compared, not parts of a line.

What do the counts mean?

Lines in is the number of lines you pasted, lines out is what remains and removed is the difference. The test showed 9, 6 and 3.

Can we use it for email lists?

Yes, and ticking Ignore case helps because addresses may be typed in different cases.

Is it safe for case-sensitive data?

Leave Ignore case off for passwords, code and Linux file names, where case matters.

Can we open a file?

Yes. Use the Open .txt file button or paste the lines.

Is our list uploaded?

No. It is processed in your browser.

More in Text Tools

See all 21 in Text Tools