Remove Duplicate Lines

Paste a list and every repeated line is removed as you type, leaving one copy of each. Choose whether case and extra spaces count, keep the first or last copy, sort the result, or list only the lines that were repeated. Your text is processed in your browser and is never uploaded.

Keep
Sort
Total lines
0
Unique lines
0
Duplicates removed
0

Features

  • Result updates live as you paste or type

  • Ignore case and trim spaces before comparing, while the kept line keeps its original text

  • Keep the first or the last copy of each repeated line

  • Sort A-Z or Z-A, with numbers in natural order (item2 before item10)

  • Show only the duplicates to see what was repeated

  • Counts total lines, unique lines and duplicates removed; copy or download the result as .txt

  • Runs in your browser: nothing is uploaded, no signup

When people use it

Email and phone lists

Merge lists from two sheets and remove the repeated addresses or numbers before an import.

Keywords and tags

Clean a keyword or hashtag list, ignoring case so "Shoes" and "shoes" count once.

Logs and exported data

Collapse repeated log lines or IDs, or switch to Show only duplicates to find which ones repeat.

How duplicate lines are matched

What counts as a duplicate

By default two lines match only if they are exactly the same, including capital letters and spaces. Tick Ignore case to treat "Apple" and "apple" as one line, and Trim spaces before comparing to ignore spaces at the start or end. The line that is kept is shown exactly as you typed it.

Windows (CRLF) and Mac/Linux line endings both work, and a newline at the very end of your text does not add an empty line.

First or last copy

  • Keep: First keeps each line where it first appears, so the list stays in its original order.
  • Keep: Last keeps the final copy of each line and places it where that copy appeared, which is useful when later entries are the newest.
  • Sort A-Z or Z-A reorders the result alphabetically, with numbers compared as numbers.
  • Remove empty lines drops blank and space-only lines. Without it, repeated blank lines collapse to one.

Other text tools

Remove Duplicate Lines - FAQ