Set Operations Calculator
Set Operations Calculator
Union, intersection, and difference are the three fundamental operations for comparing two sets, and while their definitions are simple individually, it's easy to mix them up — especially the difference operation, which gives a different answer depending on which set comes first. Enter the elements of two sets, separated by commas, and this calculator finds all of these relationships at once: what's in either set, what's shared between both, and what's unique to each one.
- The union (A ∪ B) combines every element from both sets, removing duplicates — everything that appears in A, B, or both.
- The intersection (A ∩ B) keeps only elements that appear in both sets, so an element must belong to both A and B to be included.
- The difference (A − B) keeps elements that are in A but not in B, and is not the same as B − A, which instead keeps elements in B but not in A.
What is the difference between union and intersection?
Union combines everything from both sets; intersection keeps only what's shared between both sets.
What is the intersection of {1,2,3,4} and {3,4,5,6}?
{3,4} — the only elements present in both sets.
Set Operations Calculator


Union, intersection, and difference are the three fundamental operations for comparing two sets, and while their definitions are simple individually, it's easy to mix them up — especially the difference operation, which gives a different answer depending on which set comes first. Enter the elements of two sets, separated by commas, and this calculator finds all of these relationships at once: what's in either set, what's shared between both, and what's unique to each one.

- The union (A ∪ B) combines every element from both sets, removing duplicates — everything that appears in A, B, or both.
- The intersection (A ∩ B) keeps only elements that appear in both sets, so an element must belong to both A and B to be included.
- The difference (A − B) keeps elements that are in A but not in B, and is not the same as B − A, which instead keeps elements in B but not in A.
What is the difference between union and intersection?
Union combines everything from both sets; intersection keeps only what's shared between both sets.
What is the intersection of {1,2,3,4} and {3,4,5,6}?
{3,4} — the only elements present in both sets.
