The Next JSON Toolbox

Compare Two Lists Online

Paste two lists to find the differences and the common items. Each list can be one item per line, comma-separated or a JSON array. Switch to Text or JSON mode to compare documents and JSON files line by line.

Sample:
Lines:0Chars:0
Lines:0Chars:0
Compare as

JSON Tools

Array Tools

How to Compare Two Lists

To compare two lists, paste them side by side. The result updates as you type, so you don't have to click anything.

  1. 1Paste List A. Put your first list in the left box, or click Upload and choose a .txt or .csv file. You can also drag a file onto the box.
  2. 2Paste List B. Put the second list in the right box. It does not need the same format or order as List A.
  3. 3Read the three columns. The results show items only in List A, items only in List B, and items in both lists, with a count for each.
  4. 4Adjust and copy. Turn on Ignore case or Ignore whitespace if needed, then click Copy on any column to paste it into Excel, or Download CSV to save all three groups.

Your lists never leave your browser. Nothing is uploaded or stored.

What the Results Mean

When you compare two lists, each unique item ends up in exactly one of three groups:

  • Only in A: items in the first list but not in the second (A minus B). These are the items missing from List B.
  • Only in B: items in the second list but not in the first (B minus A). These are the new or extra items.
  • In Both: items found in both lists, also called the intersection or the matches.

The similarity score is the number of shared items divided by the total number of unique items in both lists. 100% means the two lists hold exactly the same items, even if the order is different.

Supported List Formats

You don't need to clean up your data before you compare 2 lists. Each side is read separately:

  • One item per line: a column copied from Excel or Google Sheets, a text file, or any list with line breaks.
  • Comma-separated: a single line like red, green, blue, such as a CSV row or a tag list.
  • Space-separated: a single line with no commas, such as SKU-1 SKU-2 SKU-3.
  • JSON array: ["a", "b", "c"], or an array of numbers.

These two lists use different formats but can still be compared. The result: carol and dave are only in A, erin is only in B, and alice and bob are in both. Quotes around items and blank lines are removed automatically.

When to Compare 2 Lists

Comparing two lists is useful any time you have an old version and a new version, or two sources that should match:

  • Email and contact lists: find subscribers who unsubscribed, or contacts missing from your CRM export.
  • Spreadsheet columns: compare two columns from Excel or Google Sheets without writing VLOOKUP or MATCH formulas.
  • Inventory and SKUs: see which products are in the warehouse file but missing from the store, or the other way around.
  • Names and attendees: check a guest list against RSVPs, or a class roster against submitted work.
  • IDs and database exports: compare user IDs, order numbers or file names from two systems to find gaps.
  • Keywords and URLs: compare two keyword lists or sitemap URLs to find what was added or removed.

Tips for Accurate List Comparison

  • Order does not matter. apple, banana and banana, apple count as the same list.
  • Duplicates are counted once in the results. The count under each box shows how many items repeat, and Show duplicates lists them with how often they appear.
  • Use Ignore case so that Apple and apple match. This is useful for emails and names.
  • Use Ignore whitespace so that items with extra or different spaces still match.
  • Click Swap to switch List A and List B, which also swaps the "only in" groups.
  • Each side accepts up to 1 MB, which is enough for tens of thousands of items.

Compare Text and JSON Too

This tool can do more than compare two lists. Under Compare as, choose Text to compare two documents, files or code line by line. Added lines are green, removed lines are red, and changed words inside a line are highlighted.

Choose JSON to compare two JSON objects. Both are formatted first, and key order can be ignored, so only real value changes are shown. Auto Detect picks the mode for you based on what you paste.

Compare Two Lists, Texts and JSON: Examples

Three examples of what this tool can compare. Click a sample name above the left box to load any of them into the editor.

Compare Two Lists

List A has one item per line and List B is a JSON array. The comparison shows items only in List A, only in List B and in both. Order does not matter.

List A
apple
banana
cherry
grape
mango
List B
["banana", "kiwi", "apple", "peach", "mango"]
Differences
Only in A2
  • -cherry
  • -grape
Only in B2
  • +kiwi
  • +peach
In Both3
  • =apple
  • =banana
  • =mango

Compare Two Texts

Compare two versions of a document line by line. Changed words inside a line are highlighted too.

Text A
Weekend Picnic Plan
Meet at Maple Park at 10am
Bring sandwiches and lemonade
Games: frisbee and cards
Leave by 3pm
Text B
Weekend Picnic Plan
Meet at Maple Park at 11am
Bring sandwiches, fruit and lemonade
Games: frisbee and cards
Don't forget the blanket
Leave by 4pm
Differences
1
Weekend Picnic Plan
1
Weekend Picnic Plan
2
Meet at Maple Park at 10am
2
Meet at Maple Park at 11am
3
Bring sandwiches and lemonade
3
Bring sandwiches, fruit and lemonade
4
Games: frisbee and cards
4
Games: frisbee and cards
5
Don't forget the blanket
5
Leave by 3pm
6
Leave by 4pm

Compare Two JSON Objects

JSON is formatted and its keys sorted before comparing, so only real value changes show up.

Text A
{"name":"Sunny Bean","open":"8am-6pm","menu":["Honey Latte","Matcha Cloud"],"wifi":false}
Text B
{
  "wifi": true,
  "name": "Sunny Bean",
  "menu": ["Honey Latte", "Lavender Dream"],
  "open": "7am-8pm"
}
Differences
1
{
1
{
2
"menu": [
2
"menu": [
3
"Honey Latte",
3
"Honey Latte",
4
"Matcha Cloud"
4
"Lavender Dream"
5
],
5
],
6
"name": "Sunny Bean",
6
"name": "Sunny Bean",
7
"open": "8am-6pm",
7
"open": "7am-8pm",
8
"wifi": false
8
"wifi": true
9
}
9
}

Frequently Asked Questions

How do I compare two lists?

Paste the first list on the left and the second list on the right. The results appear right away in three columns: items only in List A, items only in List B, and items in both lists.

Can I compare 2 lists from Excel or Google Sheets?

Yes. Copy a column from your spreadsheet and paste it into either box. Each cell becomes one item. You can also save the columns as .csv or .txt files and upload them. You don't need VLOOKUP or any other formula.

How do I find the items that are in both lists?

Look at the In Both column. It lists every item found in both List A and List B, also called the intersection. Click Copy in its header to copy just that column, one item per line, ready to paste into a spreadsheet.

How do I find what is missing from one list?

The Only in A column shows items that are in List A but missing from List B. The Only in B column shows the reverse. Click Swap to switch the two lists.

Does the order of items or duplicates matter?

No. Lists are compared as sets, so the order is ignored and repeated items are counted once. Click Show duplicates to see which items repeat and how many times. To compare two lists line by line in order, switch Compare as to Text.

Can the comparison ignore upper and lower case?

Yes. Turn on Ignore case so that "Apple" and "apple" count as the same item. Turn on Ignore whitespace to also ignore differences in spacing.

What list formats are supported?

One item per line, comma-separated values, space-separated values on one line, and JSON arrays. Each side can use a different format. Quotes around items and empty lines are removed.

Can I also compare two texts, files or JSON objects?

Yes. Set Compare as to Text to compare two documents or files line by line, or to JSON to compare two JSON objects without false differences from formatting or key order. Uploaded files can be up to 1 MB each.

Does this site store my data in the cloud?

No, this site does not store or share your data in the cloud. Your data remains private and is kept locally on your browser.

This site lacks some useful features that I need. Can you add them?

Yes, we welcome all suggestions! Please feel free to share your feedback using the link at the bottom of the page.