Compare Three Lists
Compare three lists side by side to find common items, unique entries, and differences. Supports Venn diagram, Jaccard similarity, and export.
About
Comparing multiple lists manually invites errors. A missed duplicate or overlooked common entry in procurement, inventory reconciliation, or data migration can cascade into costly rework. This tool performs exact set operations - intersection, difference, and symmetric difference - across three input lists simultaneously. It computes the Jaccard similarity index |A โฉ B||A โช B| for each pair to quantify overlap. Results assume exact string matching after optional case normalization and whitespace trimming. Items containing only whitespace are discarded.
Formulas
The core comparison relies on standard set algebra. Given three finite sets A, B, and C, seven distinct Venn regions exist.
Where J = 0 indicates disjoint sets and J = 1 indicates identical sets. The "Only in A" region is computed as A โ (B โช C). Pairwise-exclusive overlaps use A โฉ B โ C. The triple intersection is A โฉ B โฉ C. All operations run in O(n) time via hash-set lookups.
Reference Data
| Operation | Symbol | Description | Example (A={1,2,3}, B={2,3,4}, C={3,4,5}) | Result |
|---|---|---|---|---|
| Union | A โช B โช C | All items from all lists | {1,2,3} โช {2,3,4} โช {3,4,5} | {1,2,3,4,5} |
| Common to All | A โฉ B โฉ C | Items in every list | {1,2,3} โฉ {2,3,4} โฉ {3,4,5} | {3} |
| A โฉ B only | (A โฉ B) โ C | Shared by A and B but not C | ({1,2,3} โฉ {2,3,4}) โ {3,4,5} | {2} |
| A โฉ C only | (A โฉ C) โ B | Shared by A and C but not B | ({1,2,3} โฉ {3,4,5}) โ {2,3,4} | โ |
| B โฉ C only | (B โฉ C) โ A | Shared by B and C but not A | ({2,3,4} โฉ {3,4,5}) โ {1,2,3} | {4} |
| Only in A | A โ (B โช C) | Exclusive to A | {1,2,3} โ {2,3,4,5} | {1} |
| Only in B | B โ (A โช C) | Exclusive to B | {2,3,4} โ {1,2,3,4,5} | โ |
| Only in C | C โ (A โช B) | Exclusive to C | {3,4,5} โ {1,2,3,4} | {5} |
| Jaccard(A,B) | |A โฉ B||A โช B| | Similarity ratio 0-1 | 2 รท 4 | 0.50 |
| Jaccard(A,C) | |A โฉ C||A โช C| | Similarity ratio 0-1 | 1 รท 5 | 0.20 |
| Jaccard(B,C) | |B โฉ C||B โช C| | Similarity ratio 0-1 | 2 รท 4 | 0.50 |
| Symmetric Diff | A โ B โ C | Items in odd number of lists | XOR across all three | {1,3,5} |