Skip to content

List Diff - Compare Two Lists and Find Differences

0 items
0 items

How to Compare Two Lists

Paste your first list into List A and your second list into List B, or drop a .txt or .csv file onto either box. The comparison runs as you type. Above the results you get a summary with the size of each list and how many items are shared or unique, plus a small Venn diagram. Below that, five panels show every result set at once, each with its own Copy and Download button. Download all as CSV gives you one file with a column per set, ready to open in Excel or Google Sheets.

To compare two columns from a spreadsheet, select the cells in one column, copy, and paste. Each cell becomes one line. If you copied a row or a CSV line, change Split on to Comma, Tab, Semicolon or Pipe so each cell is treated as its own item.

Worked Example

Click Load example to try this. List A is a mailing list and List B is a list of people who unsubscribed:

List A                List B
ann@example.com       cara@example.com
bob@example.com       dan@example.com
Cara@example.com      eve@example.com
dan@example.com       fay@example.com   (trailing space)
bob@example.com
fay@example.com

With the default options (case-insensitive, trim whitespace on), the results are:

  • Only in A (2): ann@example.com, bob@example.com. These are the people you can still email.
  • Only in B (1): eve@example.com, an unsubscribe for someone not on this list.
  • In both (3): Cara@example.com, dan@example.com, fay@example.com. Remove these before sending.
  • In only one list (3): ann, bob and eve.
  • Combined (6): every distinct address from both lists.

List A also reports one duplicate value: bob@example.com appears twice. If you turn on Case-sensitive, Cara and cara stop matching. If you turn off Trim whitespace, "fay@example.com " with its trailing space no longer matches either.

Options and Edge Cases

  • Case-sensitive is off by default, which suits emails, usernames and most names. Turn it on for case-sensitive data such as file paths on Linux, passwords or base64 IDs.
  • Trim whitespace removes spaces and tabs at the start and end of each item. Spreadsheet exports often add these, and they are the most common reason two identical-looking items do not match. Blank lines are always ignored.
  • Numbers are compared as text. 1000, 1,000 and 1000.00 are three different items. Make the formats consistent before comparing.
  • Sort keeps the original order by default. A–Z sorts alphabetically, and Natural sorts numbers inside text by value, so item2 comes before item10.

Common Uses

Marketers check an email list against unsubscribes or bounces. Online shops compare the SKUs in a catalogue against the SKUs in an order export to find products that never sold. Social media managers compare a followers export with a following export to see who does not follow back. Developers diff environment variable names between staging and production, or package lists between two branches.

Doing It in Excel Instead

In Excel or Google Sheets you can flag items in column A that are missing from column B with =COUNTIF(B:B, A2)=0 and fill it down. That works, but you need a second formula for the other direction, it breaks on trailing spaces unless you wrap values in TRIM, and it gets slow on large sheets. Pasting both columns here gives you all the sets at once without formulas.

Related tools: remove duplicates from one list, sort lines alphabetically or numerically, or compare two texts line by line.

Related Tools

Frequently Asked Questions

How do I compare two columns from Excel or Google Sheets?
Select the cells in the first column and copy them, then paste into List A. Do the same for the second column in List B. Each cell lands on its own line, so the lists are compared cell by cell. If you copied a whole row or a CSV line instead, set Split on to Comma or Tab so each cell becomes a separate item.
Why does an item show as different when it looks the same?
The usual causes are a trailing space, different capitalisation, or a different number format. Keep Trim whitespace on to ignore leading and trailing spaces, and leave Case-sensitive off so Bob@Example.com matches bob@example.com. Numbers are compared as text, so 1000 and 1,000 are different items. Strip the commas from one list first if you need them to match.
What is the difference between 'In only one list' and 'Combined'?
In only one list is the symmetric difference: items that appear in A or in B but not in both. Combined is the union: every distinct item from both lists, including the shared ones, with duplicates removed.
Does the tool tell me about duplicates inside a list?
Yes. Under each input you see the number of items and, if any value appears more than once, a duplicate count you can expand to see each repeated value and how many times it occurs. The result sets never contain duplicates. To clean a single list, use the List Deduplicator.
How large can the lists be?
Lists of 50,000 lines or more compare in well under a second because the tool uses hash sets rather than nested loops. The result panels show the first 500 items each so the page stays responsive, but Copy, Download and the CSV export always include every item.
Are my lists uploaded anywhere?
No. Pasted text and uploaded files are read and compared in your browser. Nothing is sent to a server, which matters when the lists contain customer emails or order data.