Union and Intersection Calculator

Enter up to three sets of numbers or values separated by commas, and this calculator finds the union and intersection of your sets. Input Set A, Set B, and an optional Set C, then see which elements appear in any set (union: A∪B) and which elements appear in all selected sets (intersection: A∩B).

Enter elements separated by commas

Enter elements separated by commas

Leave blank to work with only two sets

Results

Union (A∪B or A∪B∪C)

--

Intersection (A∩B or A∩B∩C)

--

Number of Elements in Union

--

Number of Elements in Intersection

--

Difference A − B

--

Difference B − A

--

Element Counts by Region

Results Table

Frequently Asked Questions

What is the difference between union and intersection?

The union of two sets (A∪B) contains all elements that appear in either set A, set B, or both. The intersection (A∩B) contains only the elements that appear in both set A and set B simultaneously. In short, union is 'in any', while intersection is 'in all'.

How do I find the union and intersection of two sets?

To find the union, combine all elements from both sets and remove duplicates. To find the intersection, list only the elements that appear in both sets. For example, if A = {1, 2, 3} and B = {2, 3, 4}, then A∪B = {1, 2, 3, 4} and A∩B = {2, 3}.

How do I find the union and intersection of intervals?

For intervals, the union covers the combined range of both intervals, while the intersection covers only the overlapping range. For example, [1, 5]∪[3, 8] = [1, 8] and [1, 5]∩[3, 8] = [3, 5]. This calculator works with discrete element sets, not continuous intervals.

Are the union and intersection operations commutative?

Yes, both operations are commutative. This means A∪B = B∪A and A∩B = B∩A. The order in which you list the sets does not affect the result of a union or intersection.

Are the union and intersection operations distributive?

Yes, both operations are distributive over each other. Specifically, A∪(B∩C) = (A∪B)∩(A∪C) and A∩(B∪C) = (A∩B)∪(A∩C). These are key properties used in set algebra and Boolean logic.

What is the set difference A − B?

The set difference A − B (also written A \ B) contains all elements that are in set A but not in set B. For example, if A = {1, 2, 3, 4} and B = {3, 4, 5}, then A − B = {1, 2}.

Can sets contain non-numeric elements?

Yes — sets can technically contain any distinct elements: numbers, letters, words, etc. This calculator accepts any comma-separated values, so you can enter letters or words as well as numbers and it will compute union and intersection correctly.

What happens when two sets have no elements in common?

When two sets share no common elements, their intersection is the empty set (∅), which contains zero elements. Such sets are called disjoint sets. For example, {1, 2, 3} and {4, 5, 6} are disjoint because they share no elements.

More Math Tools