Set Calculator

Compute the union, intersection, difference or symmetric difference of two sets. Enter values as a comma-separated list; the result is shown as a set and shaded on a Venn diagram.

Subset checker

Check whether every element of Set A is also in Set B.

{ 2, 3 } { 1, 2, 3, 4 } — Set A is a proper subset Set B.

What is a set?

A set is a collection of distinct objects called elements or members. Sets are unordered and contain no duplicates, so {1, 2, 3} and {3, 1, 2, 1} describe the same set. We write x ∈ A when x is an element of A, and x ∉ A when it isn't.

Set operations, piece by piece

Each card explains one thing this tool computes from your two sets A and B — what it keeps, what it drops, and how the Venn regions map to the result.

Union — A ∪ B

Everything in A, in B, or in both. Duplicates collapse to a single element in the output.

A ∪ B = { x : x ∈ A or x ∈ B }
ABA ∪ B — everything, either circle
Example
Given
A={1,2,3,4}, B={3,4,5,6}
Substitute
combine
drop repeats
Answer
{1,2,3,4,5,6}

Intersection — A ∩ B

Only the elements that appear in both A and B. Empty when the two sets are disjoint.

A ∩ B = { x : x ∈ A
x ∈ B }
ABA ∩ B — only the overlap
Example
Given
A={1,2,3,4}, B={3,4,5,6}
Substitute
keep values in both
Answer
{3,4}

Difference — A − B (and B − A)

A − B keeps the elements of A that are not in B. Order matters: A − B and B − A are usually different sets.

A − B = { x : x ∈ A
x ∉ B }
ABA − B — A minus the overlap
Example
Given
A={1,2,3,4}, B={3,4,5,6}
Substitute
strip shared 3, 4 from A
Answer
A−B={1,2}, B−A={5,6}

Symmetric difference — A △ B

Everything that belongs to exactly one of the two sets — the union with the overlap removed.

A △ B = (A ∪ B) − (A ∩ B)
ABA △ B — both circles minus overlap
Example
Given
A={1,2,3,4}, B={3,4,5,6}
Substitute
union minus {3,4}
Answer
{1,2,5,6}

Features of this calculator

  • Accepts numbers, words, or any comma-separated values
  • Automatically removes duplicates and treats sets as unordered
  • Supports union, intersection, both directions of difference, and symmetric difference
  • Renders a Venn diagram with the selected region shaded
  • Includes a separate subset checker tool

Frequently asked questions

+What does the empty set look like on a Venn diagram?

The empty set corresponds to any region with nothing shaded and no elements listed inside it. Two disjoint sets have an empty intersection — the overlap region contains no elements.

+When are two sets equal?

When they contain exactly the same elements. Because order and repetition don't matter, {a, b, c} and {c, a, b, a} are equal.

+Do the elements have to be numbers?

No. Elements can be anything — numbers, words, symbols, or even other sets. This calculator treats each comma-separated token as an element and compares them exactly.

+How is symmetric difference related to XOR?

They match exactly. An element is in A △ B when it's in A XOR B — in one set but not both — which is the same truth table as the XOR logical operator.

Related calculators

Probability Calculator and Permutation & Combination Calculator are coming soon — they will link here once published.