List Diff - Compare Two Lists and Find Differences
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
Markdown Preview
Write Markdown and see the rendered HTML output in real time.
Lorem Ipsum Generator
Generate placeholder text in paragraphs, sentences, or words.
List Deduplicator
Remove duplicate lines from a list with options for case sensitivity and sort order.
Word & Character Counter
Count words, characters, sentences, paragraphs, and estimate reading and speaking time.