Compare Two Lists

Free

What is only in one list, only in the other, and in both

Comparing two versions of the same text?Text Compare shows every change in order, line against line, and labels what is only formatting.

In a terminal

  • comm -3 <(sed 's/ *$//' a.txt | sort -u) <(sed 's/ *$//' b.txt | sort -u)

    Prints what is only in A at the margin and what is only in B indented; -12 in place of -3 prints what is in both. sed drops spaces at the end of each line and sort -u keeps one of each item. On this page's sample: john.doe, ravi.k and Sam.Lee only in A, arjun.m and sam.lee only in B.

  • sort a.txt | uniq -cd

    The items listed more than once, with how many times: on this page's sample, 2 [email protected].

  • comm -3 <(tr '[:upper:]' '[:lower:]' < a.txt | sed 's/ *$//' | sort -u) <(tr '[:upper:]' '[:lower:]' < b.txt | sed 's/ *$//' | sort -u)

    Ignores letter case by lower-casing both lists first, so Sam.Lee matches sam.lee and only john.doe and ravi.k are left only in A.

What the page does that these do not
comm prints its results sorted, and after tr in lower case, rather than in each list's own order and spelling, and it takes a comma-separated line as one item where the page splits it.
What the terminal does better
They handle lists far past the page's 10 MB file limit: two lists of a million lines each, 23 MB a side, compared in under a second, and the same line runs in a script.

On macOS, comm -i also ignores case, on lists sorted with sort -fu. GNU comm on Linux has no -i, which is why the third command lower-cases with tr instead: it works on both.

How this works

About Compare Two Lists

Paste two lists and get what is only in the first, only in the second and in both, with the repeats inside each. Order does not matter, and nothing leaves your browser.

Takes
Two lists, one item per line or separated by commas or tabs
Returns
Only in A, only in B, in both, and the repeats in each, with counts
Handles
100,000 items a side, trimmed, case-blind or sorted if you ask
Privacy
Compared on this device. Nothing is uploaded

Nothing you type leaves this page

This tool runs entirely in your browser. Nothing you type or paste is sent to Revquix or to anyone else, no account is needed, and the page keeps working with your network disconnected.

Full detail in our privacy policy and AI policy.

How to compare two lists

Paste the first list on the left and the second on the right, or open a file on either side. Put one item per line, or separate the items with commas or tabs: a column copied from a spreadsheet, a comma-separated line from an email and a copied row of cells all work. The results update as you type, and each one can be copied or downloaded as a text file with one item per line.

  • Only in A: in the first list and missing from the second
  • Only in B: in the second list and missing from the first
  • In both: in the two lists, shown once, as the first list spells it
  • Repeated in A and Repeated in B: items that appear more than once in the same list, with how many times

Order and repeats do not count

The two lists are compared as sets. An item near the top of one list and near the bottom of the other is simply in both, and an item listed three times is one item that also shows up among the repeats. That is the difference from Text Compare, which reads two versions line against line, in order, and reports what changed between them.

Options

Every option applies to both lists at once, and the results follow as soon as you change one.

  • Split on: Auto reads each list on its own, taking several lines as one item per line and splitting a single line on its tabs, or else its commas. New lines, Commas and Tabs decide for you, and every choice also ends an item at a line break
  • Trim spaces: drops the spaces at either end of each item, a no-break space included. On unless you turn it off
  • Ignore case: Asha and asha count as one item, shown as the first list spells it
  • Ignore blank lines: skips empty items and counts them apart. On unless you turn it off
  • Order: each list's own order, or every result sorted from A to Z with numbers in numeric order, so item 2 comes before item 10

Where it helps

Checking who registered for an event against who attended. Finding the customer ids one system has and the other lost. Comparing two exports of SKUs, email addresses or usernames before a migration, or two dependency lists after an upgrade.

What it will not do

It matches whole items exactly, after the options you chose, and never near misses: a typo, Pvt Ltd against Private Limited, or one person with two email addresses are different items. It does not read quotes, so a comma inside a quoted value still splits it, and it does not compare tables row by row; the CSV comparison in Text Compare does that. A character you cannot see, such as a zero-width space, makes two items different, and the Invisible Character Finder shows where one is. A file of up to 10 MB can be opened on each side, and in our tests on a laptop two lists of 100,000 items each compared in about 50 milliseconds, in a background worker, so the page keeps responding.

FAQ

Questions people actually ask

The ones that come up before somebody pastes anything in.

Is my list uploaded anywhere?

No. Both lists are compared in your browser, in a background worker, and nothing is sent to Revquix or to anyone else. That matters here, because most lists worth comparing are email addresses, phone numbers or customer ids.

How are duplicates counted?

An item that appears more than once in the same list is shown under Repeated in A or Repeated in B, with the number of times it appears. It still counts once in the comparison, so a repeated item that the other list also has is in both.

Why do two items that look the same not match?

Usually a character you cannot see. Trim spaces removes ordinary and no-break spaces at either end of an item, but a zero-width space, or any odd character inside the item, still makes it different. Letter case is the other common cause: turn on Ignore case.

Can I compare two columns from Excel or Google Sheets?

Yes. Copy one column into each side and it pastes as one item per line. A single row copied instead pastes as cells separated by tabs, and Auto splits on those as well.

How is this different from Text Compare?

Text Compare shows how one version became another: line against line, in order, with what moved and what is only formatting. This page ignores order and position and answers another question: which items each list has that the other does not.

How long can the lists be?

Pasted text has no fixed limit, and a file of up to 10 MB can be opened on each side. In our tests on a laptop, two lists of 100,000 items each compared in about 50 milliseconds in a background worker. At that size the text boxes themselves get slower to type in, which is the browser's cost of holding that much text, so paste the list or open it as a file rather than typing into it.

Next, try one of these

More from Developer, or browse the full catalogue.

When the lists should have matched

A missing item is a symptom, not the bug

When two systems ought to hold the same customers, SKUs or ids and they do not, something between them is dropping records: an import, a sync job, a join with the wrong condition. Finding which one is an hour with an engineer who has debugged that kind of pipeline before.

Talk to an engineer from ₹200/hr