Skip to content
ToolsUnlocked

Remove Duplicate Lines

Remove duplicate lines from any list and keep only the first copy of each. Paste email lists, keywords, names or product codes, choose whether to ignore upper and lower case or extra spaces, and get a tidy list of unique lines with a count of how many duplicates were removed.

Runs in your browser Free, no sign-up
Remove Duplicate Lines

How to remove duplicate lines

  1. 1 Paste your list into the Your text box, one item per line.
  2. 2 Choose the options you need, such as Ignore upper and lower case.
  3. 3 The unique lines appear instantly in the Result box.
  4. 4 Press Copy result or Download .txt.

Why some duplicates are not removed

Two lines only count as the same when every character matches. The usual reasons a duplicate survives are invisible:

  • Trailing spaces or tabs at the end of one copy. Turn on ignore spaces, or clean the list first with Remove Extra Spaces.
  • Different capitals, such as Ali@mail.com and ali@mail.com. Turn on ignore case for emails and names.
  • Look-alike characters, such as a non-breaking space copied from a web page.

The first copy of each line is kept, so the original order stays. To put the clean list in order, use Sort Lines Alphabetically.

Features

Keeps the first copy

Lines stay in their original order unless you choose to sort.

Case and space options

Treat Apple and apple, or lines with stray spaces, as the same.

Duplicate count

See exactly how many repeated lines were removed.

Sort option

Sort the unique list from A to Z in one tick.

When to use it

Email lists

Remove repeated addresses before a mailing. Sort the clean list with Sort Lines Alphabetically.

Keyword research

Combine keyword exports and keep unique terms. Number each item with Add Line Numbers.

Data cleaning

Tidy IDs, codes and names copied from spreadsheets. Hidden spaces? Remove Extra Spaces before removing duplicates.

Inventory lists

Merge stock lists without repeats. Compare the old and new lists with the Diff Checker.

Related Text tasks

Frequently asked questions

Which copy of a duplicate is kept?

The first time a line appears is kept, and later copies are removed. The original order is preserved.

How do I ignore capital letters?

Tick Ignore upper and lower case, so Apple, APPLE and apple count as the same line.

Why are some duplicates not removed?

They may differ by spaces at the start or end, or by invisible characters. Keep Ignore spaces at the start and end ticked, or run the text through our Text Cleaner first.

Can I remove duplicates from a spreadsheet column?

Yes. Copy the column, paste it here, then paste the unique result back into your spreadsheet.

Can I remove duplicate emails from a mailing list?

Yes. Paste one email per line and turn on ignore case, because Ali@mail.com and ali@mail.com reach the same inbox. The cleaned list keeps the first copy of each address in its original order.

Can I see how many duplicates were removed?

Yes. Under the result the tool shows how many duplicate lines were removed and how many unique lines are left.

Does it remove blank lines?

Only if you turn on the option to remove empty lines. Otherwise blank lines are treated like any other line, so only the first one is kept.

Can I sort the result at the same time?

Yes. Turn on sort the result A to Z and the unique lines come out in alphabetical order.

How this tool works. These text tools run entirely in your browser with plain JavaScript, so the text you paste never leaves your device and results update as you type. Each tool is tested with real text such as copied PDFs, emails, code, lists, emojis and non-English scripts before it goes live.

HF

Built and reviewed by , founder and lead developer
Last updated · How we check our tools · Report a problem