How-to guide

How to Compare Two Lists

To compare two lists, paste one into each side of a list comparison tool and choose what you want to see: entries in both, entries only in the first, only in the second, or the merged list. Decide first whether case and surrounding whitespace should matter, because those two settings determine what counts as a match at all.

List Comparison

Find what two lists share and what only one of them has.

Open the tool

There are two different questions people mean by "compare these lists", and they need different tools. One is "what do these two sets have in common?" — order is irrelevant, and an entry appearing twice in one list changes nothing. The other is "what edits turn this document into that one?" — order matters, and a moved line is a change.

This guide covers the first. If you are comparing two versions of a document rather than two sets of entries, the text difference checker is the tool you want.

Step by step

  1. Put one list in each box

    One entry per line. Blank lines are ignored, so a trailing newline or a gap between blocks does not become an entry.

  2. Decide whether case matters

    Leave case matching off for email addresses, domains and URLs, where case carries no meaning in practice. Turn it on for identifiers, tokens and API keys, where Admin and admin are genuinely different values.

  3. Decide whether spacing matters

    Leave whitespace trimming on unless the spacing is meaningful. Lists pasted from spreadsheets and email clients routinely carry trailing spaces, and without trimming those entries silently fail to match.

  4. Choose what to show

    In both lists answers "which of these overlap?". Only in the first answers "what did I lose?". Only in the second answers "what is new?". Combined gives you a merged list with duplicates removed.

  5. Check the summary line

    It reports how many unique entries each list held and how many were shared. If the shared count is zero when you expected overlap, the matching settings are almost always the reason.

Example

Case matching off, so CAROL and carol are the same person.

Two lists

First          Second
ada@ex.com     bob@ex.com
bob@ex.com     CAROL@ex.com
carol@ex.com   erin@ex.com
dave@ex.com

Results

In both:            bob@ex.com, carol@ex.com
Only in the first:  ada@ex.com, dave@ex.com
Only in the second: erin@ex.com

Frequently asked questions

Should I use this or the text difference checker?
Use this when the lists are sets of entries and order does not matter — mailing lists, IDs, inventory. Use the difference checker when you are comparing two versions of the same document and want to see what changed, where.
Why do two entries that look identical not match?
Nearly always an invisible difference: a trailing space, a non-breaking space pasted from a web page, or different case with case matching turned on. Run both lists through the text cleaner first if you suspect hidden characters.
What happens to duplicates within one list?
They collapse to a single entry before comparing, because the question is whether an entry is present rather than how often. For counts, use the duplicate line remover in its duplicates-only mode.
Can I compare more than two lists?
Not in one pass. Compare the first two, take the combined result, and compare that against the third. Doing it in stages also makes it clearer where an entry dropped out.

Tools used in this guide

All tools →
All guides →

Last reviewed .