Skip to content
DeviceCheckHub

Remove Duplicate Lines

This duplicate line remover deletes repeated lines from any list while you type, keeps the order of the rest, and shows which lines were repeated and how many times.

Removed 3 duplicate lines and 1 empty line. 5 lines left.

Repeated lines

LineTimesOn lines
banana32, 5, 8
cherry24, 9

How to remove duplicate lines

  1. Paste your list into the box on the left, or press Open a file to load a .txt or .csv file, one item per line: email addresses, names, product codes, keywords, links or any other text. A column copied from a spreadsheet pastes the same way.
  2. The result appears on the right while you type. Each line is kept the first time it appears, later copies are removed, and the lines stay in their original order.
  3. Choose what to keep under Keep: the first copy, the last copy, only the lines that appear once, or only the lines that are repeated.
  4. Tick the options you need: ignore capital letters, ignore spaces at the ends, remove empty lines or sort the result A to Z.
  5. Press Copy to paste the clean list somewhere else, or Download .txt to save it.

When two lines count as the same

By default, two lines are duplicates only when they match exactly, character for character. That is the safe choice for things where capitals matter, such as passwords, codes and file names on Linux. Two options loosen the match:

Spaces between words always count, so “New York” and “NewYork” stay different, and so do accented letters: “resume” and “résumé” are not duplicates.

Keep the first copy, the last copy, or neither

Seeing what was repeated

The Repeated lines table under the tool lists every line that appears more than once, with how many times it appears and the line numbers where it appears, the most frequent first. Line numbers count every line you pasted, empty ones included, so they match the line numbers in a text editor or a spreadsheet row number when the list starts in row 1. It is a quick way to count votes or survey answers, find the keyword that turns up most often, or check which customer was entered several times before you remove the copies. The count above the box shows how many lines you pasted, and the message under the buttons says how many were removed.

Removing duplicates in Excel, Google Sheets and on the command line

Pasting the list here is quicker for a one-off job, works on a phone, keeps the order, and shows the repeat counts that those commands do not.

When removing duplicate lines helps

To remove line breaks instead of lines, use remove line breaks. To compare two versions of a text side by side, try text compare, and to put a list in a random order, the list randomizer.

Tips

Your list stays on your device

Repeated lines are found in your browser, and your text is never uploaded to this website or anyone else, so it is safe to use with email lists and customer data. Only your settings are remembered on this device; the text is gone when you close the page.

Frequently asked questions

How do I remove duplicate lines?

Paste your text into the box, one item per line, and the lines without repeats appear next to it straight away. The first copy of each line is kept in its place and later copies are removed. Press Copy or Download .txt to keep the result.

Does it treat “Apple” and “apple” as the same line?

Only if you tick “Ignore capitals”. By default lines must match exactly, letter for letter, to count as duplicates, which is safer for codes and passwords. With the box ticked, the spelling of the copy that is kept is shown.

What about spaces at the start or end of a line?

With “Ignore spaces at the ends” ticked, which is the default, “cherry” and “cherry ” followed by a space count as the same line, and the result has the extra spaces taken off. Spaces between words always count.

Can I keep only the lines that are not repeated?

Yes. Choose “Only lines that appear once” and every line that has a copy is removed completely, copies and all. Choose “Only the repeated lines” to get the opposite: one copy of each line that appears more than once.

How do I see how many times each line repeats?

The table under the result lists every repeated line with the number of times it appears and the numbers of the lines it is on, most frequent first. It shows the first 50 repeated lines and says how many more there are.

Is my text uploaded?

No. Repeated lines are found in your browser, and your text is never sent to this website or anyone else. Only your settings are saved on this device.

Last updated · About DeviceCheckHub