Guide · Updated June 2026
Set operations sound academic, but they describe something you already do by hand when you scan two lists for matches. Here’s what each one means, using two small example lists:
List A: Kyoto, Lisbon, Oslo, Reykjavik, Tallinn
List B: Lisbon, Oslo, Vienna, Zagreb
Difference (A − B)
Items in A that don’t appear in B: Kyoto, Reykjavik, Tallinn. This is the one people ask for most — “what’s missing from the second list?”
Intersection (A ∩ B)
Items present in both lists: Lisbon, Oslo. Useful for finding confirmed matches — subscribers on two mailing lists, records that exist in both systems, or duplicate entries between sources.
Union (A ∪ B)
Every distinct item from either list, with duplicates removed: Kyoto, Lisbon, Oslo, Reykjavik, Tallinn, Vienna, Zagreb. This is your combined master list.
Symmetric difference (A Δ B)
Everything that appears in exactly one list, but not both: Kyoto, Reykjavik, Tallinn, Vienna, Zagreb. It’s the union minus the intersection — the complete change set between two versions of a list.
Which one do you actually need?
- Checking what changed since last time? Start with symmetric difference.
- Reconciling two customer exports? Use intersection for confirmed matches and the two differences for outliers on each side.
- Building one clean master list from two sources? That’s a union, usually followed by de-duplication.
See all five results for your own lists.
Open the tool