Skip to main content

MATH · SET THEORY

Set Theory Calculator

Compute set union, intersection, difference, symmetric difference, complement, subset checks, and power sets. Enter elements as comma-separated lists.

Operation
Sets
A ∪ B — Union
Result set
{1, 2, 3, 4, 5}
|Result| = 5
|A|3
|B|3
SummaryA ∪ B = {1, 2, 3, 4, 5}

About This Calculator

Calculate set operations for discrete mathematics. Enter the elements of set A and set B as comma-separated lists, choose an operation (union, intersection, difference, symmetric difference, complement, subset, or power set), and see the result instantly with cardinality counts.

How It Works

Elements are strings — numbers, letters, or words — separated by commas. Duplicates are automatically removed. Union gives all unique elements from both sets; intersection gives shared elements; difference gives elements in A but not B; complement gives elements in the universal set U not in A; power set lists all possible subsets of A (limited to 16 elements, which produces 65,536 subsets at maximum).

The Formula

A ∪ B = {x | x ∈ A or x ∈ B} A ∩ B = {x | x ∈ A and x ∈ B} A △ B = (A − B) ∪ (B − A) |𝒫(A)| = 2^|A|

A, B
input sets
U
universal set (for complement operation)
empty set
𝒫(A)
power set of A — all subsets

Frequently Asked Questions

What is the difference between difference and symmetric difference?
Set difference (A − B) returns elements that are in A but not in B — it is not commutative (A−B ≠ B−A). Symmetric difference (A △ B) returns elements that are in either A or B, but not both — it is commutative (A△B = B△A) and equals (A−B) ∪ (B−A).
What is a power set?
The power set 𝒫(A) is the set of all possible subsets of A, including the empty set ∅ and A itself. A set with n elements has exactly 2ⁿ subsets. For example, {a, b} has the power set {∅, {a}, {b}, {a,b}} — four subsets. This calculator caps the power set at 16 elements (65,536 subsets) to prevent the browser from locking up.
Are elements case-sensitive?
Yes — "apple" and "Apple" are treated as different elements. This follows standard mathematical set theory. If you want case-insensitive comparison, convert all elements to the same case before entering them.
What is the complement of a set?
The complement A̅ (relative to a universal set U) is the set of all elements in U that are not in A. You must specify U explicitly because "all possible elements" is context-dependent. For example, if U = {1, 2, 3, 4, 5} and A = {1, 2}, then A̅ = {3, 4, 5}.