Skip to content
StringNook
Menu

Remove duplicate lines

Paste a list to remove every repeated line and keep the first of each, in the original order or sorted. Ignore differences in case and spacing if you like, and see which lines were duplicated.

Off: your text is gone when you close the page. It is never sent anywhere.

Of each repeated line, keep

Each repeated line stays where it first appears.

The result appears here.

  • Your text stays on your device
  • Free, no sign-up
  • Works on phone and desktop

How to remove duplicate lines

  1. 1

    Paste your list or text, one item per line: email addresses, names, keywords, product codes or log lines.

  2. 2

    Choose which copy of each repeated line to keep: the first, the last, or none to keep only lines that never repeat.

  3. 3

    Turn on Ignore case if “Ana” and “ana” are the same for you. Extra spaces are ignored unless you turn that off.

  4. 4

    Copy the cleaned list, and check Repeated lines to see what was duplicated and how many times.

Features

  • Keeps your order

    Repeats are removed where they are, so the rest of the list stays in its original order unless you choose to sort it.

  • Shows what repeated

    A table lists every line that appeared more than once and how often, which helps you trace where duplicates came from.

  • Handles long lists

    Tens of thousands of lines are cleaned in a moment as you paste, with a count of how many were removed.

  • Private

    Customer emails and other lists are processed in your browser and never uploaded or stored.

What each setting does, on one example

Take this short mailing list, where one address appears twice exactly and another appears once in capitals: ana@example.com, ben@example.com, Ana@Example.com, cho@example.com, ben@example.com. Here is what the tool returns with each setting:

SettingResultLines removed
Keep the first copy (default)ana@example.com
ben@example.com
Ana@Example.com
cho@example.com
1
Keep the last copyana@example.com
Ana@Example.com
cho@example.com
ben@example.com
1
Keep no copiesana@example.com
Ana@Example.com
cho@example.com
2
Ignore case, keep the firstana@example.com
ben@example.com
cho@example.com
2

Keeping the first copy is the usual choice. Keeping the last copy matters when a list grows over time and later entries are more up to date, for example when the same product code is listed again with a corrected name. Keeping no copies is a quick way to see what appears only once.

Cleaning an email list

Mailing lists collect duplicates when sign-ups are merged from several forms, spreadsheets or events, and sending the same message twice to one person looks careless. Before you import a list into a newsletter service:

  • Turn on Ignore case. Domain names are not case-sensitive, and in practice mailbox names aren’t either at almost every provider, so Ana@Example.com and ana@example.com reach the same inbox. (The email standard, RFC 5321, technically allows the part before the @ to be case-sensitive, but it discourages relying on that.)
  • Leave “Ignore extra spaces” on. A space pasted after an address is invisible but makes it a different line.
  • Watch for Gmail dots. Gmail ignores dots in addresses, so ana.lee@gmail.com and analee@gmail.com are one inbox. This tool does not merge those, because other providers treat dots as part of the name.

The Repeated lines table shows which addresses were entered more than once, which can point to a form that submits twice or a spreadsheet that was imported two times.

Other lists worth deduping

Keyword lists for ads or SEO, where the same phrase comes from several tools; guest lists and class rosters built from several replies; product codes or order numbers copied from different reports; tags and hashtags; and log files, where “Keep no copies” leaves the one-off errors that stand out from routine messages. If the order doesn’t matter, turn on “Sort the result A to Z” to get a tidy, deduplicated list in one step.

For more ways to sort, such as by last name or naturally with numbers, use alphabetical order. To see what changed between two versions of a list rather than what repeats within one, use text compare in line mode, and to fix lines that were broken in the middle by a PDF, use remove line breaks.

Frequently asked questions

How do I remove duplicate lines from a list?

Paste the list into the box, one item per line. Duplicates disappear straight away: the first copy of each line stays in its place and the later copies are removed. The line under the result says how many were removed and how many lines are left; copy the result or download it as a text file.

Does it treat "Apple" and "apple" as duplicates?

Not by default, because in some lists capitals matter. Turn on "Ignore case" to treat lines that differ only in capital letters as the same. The copy that stays is written the way it first (or last) appeared.

Why are some duplicates not removed?

Lines that look the same can differ in ways you can’t see: a non-breaking space, a different dash or apostrophe, or capital letters. Spaces at the ends of lines are already ignored. Turn on "Ignore case", and if a pair still survives, retype one of them to rule out a look-alike character.

What does "Keep no copies" do?

It removes every copy of a repeated line, so only lines that appear exactly once remain. It is useful for finding the unique entries in two lists pasted one after the other: anything that was in both lists disappears, leaving what appears in only one of them.

Can I remove duplicate words or sentences instead of lines?

This tool compares whole lines. To dedupe a comma-separated list, open the alphabetical order tool, choose to split items at commas and turn on "Remove duplicates"; it can put the result back on one line with commas.

Can I remove duplicates in Excel or Google Sheets instead?

Yes: Excel has Data > Remove Duplicates and Google Sheets has Data > Data cleanup > Remove duplicates, which work on whole rows. Pasting a column here is quicker when you just need a clean list, and it also shows which entries were repeated.

More free tools