Handitab

Remove Duplicate Lines

Remove duplicate lines from a list and keep the first copy of each, with options to ignore letter case, trim spaces, and sort the result.

About Remove Duplicate Lines

A duplicate line remover is a tool that deletes repeated lines from a list and keeps one copy of each. It reads the lines top to bottom, keeps the first occurrence, and drops later matches, so the original order is preserved unless you turn on sorting. Options ignore letter case and leading or trailing spaces. Lines must match in full: near duplicates and repeated words inside a line are not detected.

Also known as: Duplicate Line Remover, Duplicate Remover, Remove Duplicate Line.

How to use Remove Duplicate Lines

  1. Type or paste into the "Input text" box, or press "Use example" to try it with sample data.
  2. Set "Ignore letter case", "Ignore leading and trailing spaces" and "Sort the result A to Z" if the defaults do not fit.
  3. The result appears below and updates as you type.
  4. Copy the result with the copy button, or download it as a file where that is offered.

Questions about Remove Duplicate Lines

Which copy is kept when a line appears more than once?

The first occurrence is kept and every later match is removed. With "Ignore letter case" on, "Apple" and "apple" count as the same line and the spelling that appears first is the one that stays.

Does removing duplicates change the order of my list?

No, the remaining lines stay in their original order. The list is only reordered if you tick the sort option, which sorts the result alphabetically after the duplicates are removed.

Runs in your browser. Page last updated .

More text tools

All 56 text tools