Skip to content
ToolPlankDEV
Text Tools
100% In-Browser Execution

Updated:

Compare Two Lists

Use this tool to compare two lists. Paste list A and list B and you get the items only in A, only in B, in both, and all unique items, each with a count. Ignore case, trim spaces and use commas or new lines. Nothing is uploaded.

Processing in browser...

Loading the tool. It runs entirely in your browser, so your data is never uploaded.

More free tools you may need next.

Quick Guide

How to use Compare Two Lists

Simple step-by-step instructions to get the exact output you need.

  1. 01

    Paste list A and list B

    Put one item on each line in List A and List B. You can also press Paste, press Open file to load a .txt or .csv file, or press Example to see a short pair of lists. A column copied from Excel or Google Sheets arrives as one item per line.

  2. 02

    Choose how items are matched

    Ignore case is on, so Ben@example.com and ben@example.com count as one item. Trim spaces removes stray spaces at the edges, and Skip empty items drops blank lines. If your items sit on one line, pick Commas, Semicolons or Tabs under Items are separated by.

  3. 03

    Read the four results

    Only in A and Only in B are the differences. In both lists is what the two lists share. All unique items is the combined list with every item once. The line above the results gives the counts.

  4. 04

    Copy or download a result

    Each result has its own Copy and Download buttons. Under Copy results separated by you can switch the output from one item per line to a comma separated or semicolon separated line. Swap A and B turns Only in A into Only in B.

How to Compare Two Lists Online

To compare two lists, paste the first one into List A and the second into List B. The tool reads every item once, remembers it, and then checks each item of one list against the other. The answer is four lists: the items that are only in A, the items that are only in B, the items in both, and every unique item together.

Here is the Example with Ignore case on. List A has six lines, and ana@example.com appears twice. List B has five lines, and the last one has a space after it. These are the results:

Text
Only in A (2)
ana@example.com
eli@example.com

Only in B (2)
finn@example.com
gia@example.com

In both lists (3)
Ben@example.com
cara@example.com
dev@example.com

All unique items (7)
ana@example.com
Ben@example.com
cara@example.com
dev@example.com
eli@example.com
finn@example.com
gia@example.com

Ben@example.com matched ben@example.com because case is ignored, and dev@example.com matched even with the extra space because spaces are trimmed. The repeated ana@example.com is listed once.

Find the Differences Between Two Lists

The two difference lists answer different questions. Only in A is what list A has and list B lacks. Only in B is the reverse. If A is your master list and B is what you received, Only in A is what is missing and Only in B is what you did not expect.

To find the differences between two lists in one view, read Only in A and Only in B together. If both are empty, the two lists hold the same items, whatever their order or how often an item repeats.

What the Options Do

  • Ignore case: Apple, apple and APPLE are one item. Items that match in both lists show the spelling from list A.
  • Trim spaces: removes spaces and tabs at the start and end of each item before it is compared. Turn it off when the spaces are part of your data.
  • Skip empty items: blank lines and empty entries are left out. Turn it off to count an empty line as an item.
  • Items are separated by: new lines by default. The comma, semicolon and tab choices also split on new lines, so a pasted block with several items per line still works.
  • Copy results separated by: changes only how the results are written when you copy or download them.

Matching is exact apart from case and spaces. The tool does not guess that Jon and John are the same person, and it does not match similar spellings.

List Compare for Duplicates Inside One List

Open Duplicates inside each list to compare two lists for duplicates. It shows every item that appears more than once in A or in B with its count, and the total number of items against the number of unique items. In the Example, ana@example.com appears twice in list A.

Repeats never change the four results, because each item is counted once. If you only want one clean list without duplicates, use Remove Duplicate Lines.

How to Compare Two Lists in Excel

To compare two lists in Excel without a tool, put list A in column A and list B in column B, then add a helper column. This formula marks each item of list A that is also in list B:

Text
=IF(ISNUMBER(MATCH(A2, B:B, 0)), "in both", "only in A")

Fill it down, then do the same from the other side to find the items only in B. MATCH ignores case, so it behaves like Ignore case here. In Excel 365 and Excel 2021, XLOOKUP does the same job.

To compare two Excel lists with this tool instead, copy each column, paste it into its own box and read the results. Copy a result and paste it back into a column. For lists that live in separate files, Merge CSV Files can put them together first.

Compare Two Lists in Python or JavaScript

A set holds each item once, which is the same idea this tool uses. In Python, keep the order of list A like this:

Python
a = ["apple", "banana", "cherry"]
b = ["banana", "cherry", "date"]
set_a, set_b = set(a), set(b)
only_a = [x for x in a if x not in set_b]
only_b = [x for x in b if x not in set_a]
both = [x for x in a if x in set_b]
print(only_a, only_b, both)

The output is ['apple'] ['date'] ['banana', 'cherry']. In JavaScript, build a Set from each array and use filter with has in the same way. A one-off comparison of two pasted lists is faster in the tool than in a script.

When to Use It and Its Limits

  • Email, ID or keyword lists: see who is on one list and not the other.
  • Inventory, SKUs or file names: check an export against a master list.
  • Hostnames, IP addresses or usernames: spot what changed between two snapshots.
  • To get a sorted result, copy a list into Sort Lines. To turn a result into one comma separated line, use List to Comma Separated.

The tool compares whole items. It does not compare columns of a table row by row, it does not handle three lists at once, and it does not match similar spellings. Characters are compared as written, so an é typed as one character and an é typed as e plus an accent mark count as different items. Each list can hold up to 2,000,000 items, and a pasted text is limited to 2,000,000 characters.

Privacy

Both lists are compared in your browser. Nothing is uploaded or stored, so lists of emails or customer IDs stay on your device. See the Privacy Policy for details.

Frequently Asked Questions

Technical Q&A for Compare Two Lists

Common questions about edge cases, character encoding, and privacy guarantees.

Paste the first list into List A and the second into List B, one item per line. The results appear at once as Only in A, Only in B, In both lists and All unique items.

Read Only in A and Only in B. Only in A holds the items missing from list B, and Only in B holds the items missing from list A. Both empty means the lists have the same items.

Add a helper column with =IF(ISNUMBER(MATCH(A2,B:B,0)),"in both","only in A") and fill it down. Or copy each column into this tool and copy the results back.

Yes. Select a column in Excel or Google Sheets, copy it, and paste it into a box. Each cell becomes one line, so the lists compare without any cleanup.

No. An item matches wherever it sits in the other list. The results keep the order in which each item first appears.

Only if you turn Ignore case off. It is on by default, so Apple and apple match. With it off, they are two different items.

Open Duplicates inside each list. It shows every item that appears more than once in each list and how many times. The four results count each item only once.

Yes. Pick Commas under Items are separated by. Semicolons and tabs work the same way, and new lines still split items in every mode.

Each list can have up to 2,000,000 items. Very large lists take a moment, and the result boxes show a preview while Copy and Download use the full lists.

No. The comparison runs in your browser and nothing is sent anywhere or stored.