List Comparer - Compare Two Lists & Find Differences
Compare two lists to find unique items, duplicates, intersections, and unions using set operations — 100% client-side, no data sent to server.
No items found
Frequently Asked Questions
What is a List Comparer and why do I need one?
A List Comparer is a tool that takes two lists of items and performs set operations to find differences, common elements, and combined results. It is essential for data reconciliation tasks such as comparing email subscriber lists, verifying database migrations, auditing server configurations, finding missing entries between spreadsheet exports, or analyzing follower lists on social media.
How do I use this List Comparer tool?
Enter your items in the List A and List B text areas, with one item per line. The tool automatically compares the lists in real-time as you type. Results are organized into tabs: Only in A shows items exclusive to List A, Only in B shows items exclusive to List B, Intersection shows items in both lists, Union shows all unique items combined, and Symmetric Difference shows items that are in one list but not both.
Is my data safe? Are my lists uploaded to a server?
Your data is 100% safe and never leaves your browser. All list comparison operations are performed client-side using JavaScript running directly in your browser. No data is transmitted to any server, no data is stored, and no tracking of your list contents occurs. This makes the tool safe for comparing sensitive data such as email addresses, user IDs, or proprietary records.
What is the difference between Difference and Symmetric Difference?
Difference (A - B) gives you items that are in List A but NOT in List B. It is directional: A - B and B - A give different results. Symmetric Difference (A XOR B) gives you ALL items that are in either list but NOT in both — it is the combination of (A - B) and (B - A). In other words, symmetric difference removes the overlap and shows everything unique to one list or the other.
How does case sensitivity affect comparison?
When case sensitivity is enabled (the default), Apple and apple are treated as different items. When case sensitivity is disabled, they are treated as the same item. For developer workflows like comparing code identifiers or file paths, case-sensitive mode is usually correct. For human-readable data like names or cities, case-insensitive mode is often more appropriate.
What is the Jaccard Similarity Index shown in the statistics?
The Jaccard Index (also called Jaccard Similarity Coefficient) measures how similar two sets are. It is calculated as the size of the intersection divided by the size of the union: J(A,B) = |A ∩ B| / |A ∪ B|. A value of 0 means the lists have no items in common, and a value of 1 (100%) means the lists are identical. This metric is widely used in data science for measuring set similarity.
How does the tool handle duplicates within a single list?
The tool detects duplicates within each list and shows them in the Dup A and Dup B tabs, along with occurrence counts. For the set operations (difference, intersection, union), each unique item is counted once regardless of how many times it appears.
Can this tool handle very large lists?
Yes. The tool uses JavaScript Set operations which are highly optimized in modern browsers. Lists with up to 100,000 items can be compared in under 500 milliseconds. The tool uses a 300ms debounce so results update smoothly even as you paste large datasets. For the best experience with very large lists, paste the complete list at once rather than typing line by line.
Code Examples
// List comparison using JavaScript Set operations
function compareLists(listA, listB, options = {}) {
const { caseSensitive = true, trimWhitespace = true } = options;
const normalize = (item) => {
let result = item;
if (trimWhitespace) result = result.trim();
if (!caseSensitive) result = result.toLowerCase();
return result;
};
const itemsA = listA.map(normalize).filter(Boolean);
const itemsB = listB.map(normalize).filter(Boolean);
const setA = new Set(itemsA);
const setB = new Set(itemsB);
const onlyInA = [...setA].filter((item) => !setB.has(item));
const onlyInB = [...setB].filter((item) => !setA.has(item));
const intersection = [...setA].filter((item) => setB.has(item));
const union = [...new Set([...setA, ...setB])];
const symmetricDiff = [...onlyInA, ...onlyInB];
const jaccardIndex = union.length > 0
? intersection.length / union.length : 0;
return { onlyInA, onlyInB, intersection, union, symmetricDiff,
stats: { jaccardIndex: Math.round(jaccardIndex * 1000) / 1000 } };
}
// Usage
const a = ['apple', 'banana', 'cherry', 'date'];
const b = ['banana', 'date', 'elderberry', 'fig'];
const result = compareLists(a, b);
console.log('Only in A:', result.onlyInA);
// ['apple', 'cherry']
console.log('Intersection:', result.intersection);
// ['banana', 'date']