Union and Intersection Calculator

Quick answer

The union and intersection calculator finds A ∪ B, A ∩ B, the differences and the symmetric difference of two or three sets of numbers or words.

Union
{1, 2, 3, 4, 5, 6, 7}
Intersection
{4, 5}
Only in A
{1, 2, 3}
Only in B
{6, 7}
A − B
{1, 2, 3}
Symmetric difference A △ B
{1, 2, 3, 6, 7}
Sizes
|A| = 5, |B| = 4, |A ∪ B| = 7

Set operations describe how groups overlap: students taking maths or physics (union), both (intersection), or only one of them (symmetric difference). They are the language of probability and databases.

How to use the Union and Intersection Calculator

  1. Number of sets
  2. Set A (separate with commas)
  3. Set B
  4. Set C

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

Duplicates are removed and elements are sorted. With three sets the intersection is the set of elements common to all three, and the “only” sets contain elements that appear in exactly one set.

Formula

A ∪ B = {x | x ∈ A or x ∈ B} A ∩ B = {x | x ∈ A and x ∈ B} A − B = {x | x ∈ A and x ∉ B}

Worked example

Inputs — Number of sets: Two sets (A, B); Set A (separate with commas): 1, 2, 3, 4, 5; Set B: 4, 5, 6, 7.
Results — Union = {1, 2, 3, 4, 5, 6, 7}; Intersection = {4, 5}; Only in A = {1, 2, 3}; Only in B = {6, 7}; A − B = {1, 2, 3}; Symmetric difference A △ B = {1, 2, 3, 6, 7}.

Key terms

Union
Elements in at least one set.
Intersection
Elements in every set.

Frequently asked questions

What is the union of {1, 2} and {2, 3}?

{1, 2, 3}.

What is the intersection of {1, 2} and {3, 4}?

∅, the empty set – the sets are disjoint.

What is the symmetric difference?

Elements in exactly one of the sets: (A − B) ∪ (B − A).

How do union sizes relate to intersections?

|A ∪ B| = |A| + |B| − |A ∩ B| (inclusion–exclusion).

Sources

  1. OpenStax – Contemporary Mathematics
  2. Wolfram MathWorld – Union
  3. Wolfram MathWorld – Intersection

Cite this calculator

Speedy Calculator. (2026). Union and Intersection Calculator. Speedy Calculator. https://speedycalculator.com/calculators/math/union-intersection/