Compare Two Lists
Compare two lists side by side to find common items, unique entries, and duplicates. Supports case-sensitive matching and multiple delimiters.
About
Comparing two datasets manually is where errors compound. A single missed entry in a reconciliation between, say, an inventory export and a purchase order can cascade into fulfillment failures or financial discrepancy. This tool performs formal set operations - union (A βͺ B), intersection (A β© B), and symmetric difference (A Ξ B) - on two plain-text lists. It also detects intra-list duplicates, which spreadsheet VLOOKUP workflows routinely miss. Results are exportable and print-ready.
The comparison engine normalizes whitespace and supports configurable delimiters (newline, comma, semicolon, tab). Case sensitivity is togglable. Note: this tool performs exact string matching after normalization. It does not perform fuzzy or phonetic matching. Two entries differing by a single whitespace character inside the string will be treated as distinct items unless trimming captures it.
Formulas
The core comparison relies on set-theoretic operations applied to the parsed item collections.
The Jaccard similarity index quantifies how similar the two lists are:
Where A and B are the sets of unique items from each list, |A| is the cardinality (count of unique items) of set A, and J ranges from 0 (no overlap) to 1 (identical sets).
Duplicate detection uses a frequency map: for each item x in the list, increment a counter. Any x with count > 1 is flagged as a duplicate.
Reference Data
| Operation | Symbol | Description | Example (A = {1,2,3}, B = {2,3,4}) | Result |
|---|---|---|---|---|
| Intersection | A β© B | Items present in both lists | Common items | {2, 3} |
| Union | A βͺ B | All unique items from both lists combined | All items merged | {1, 2, 3, 4} |
| Difference (A \ B) | A β B | Items only in List A | Only in A | {1} |
| Difference (B \ A) | B β A | Items only in List B | Only in B | {4} |
| Symmetric Difference | A Ξ B | Items in either list but not both | Exclusive items | {1, 4} |
| Duplicates in A | - | Items appearing more than once within List A | If A = {1,2,2,3} | {2} |
| Duplicates in B | - | Items appearing more than once within List B | If B = {2,3,3,4} | {3} |
| Cardinality of A | |A| | Total number of items in List A | Count | 3 |
| Cardinality of B | |B| | Total number of items in List B | Count | 3 |
| Jaccard Index | J(A,B) | Similarity coefficient: intersection / union | 2 Γ· 4 | 0.50 |
| Overlap Coefficient | O(A,B) | Intersection / min(|A|, |B|) | 2 Γ· 3 | 0.67 |
| SΓΈrensen - Dice | D(A,B) | 2 Γ intersection / (|A| + |B|) | 4 Γ· 6 | 0.67 |