Set Theory Calculator

Enter elements for Set A and Set B (comma-separated), choose an operation, and instantly get the result with a visual Venn diagram.

Separate elements with commas. Works with numbers, letters, or words.

How to use

  • Enter your sets
    Type elements separated by commas. Works with numbers (1, 2, 3), letters (a, b, c), or words (cat, dog). Duplicates are removed automatically.
  • Choose an operation
    Select from 9 set operations. Complement requires a Universal Set U — a field appears automatically when you select it.
  • Read the result
    See the result set, cardinality, a Venn diagram, and a step-by-step explanation of how the operation works.

Set Operations

SymbolOperationMeaning
A ∪ BUnionAll elements in A or B (or both)
A ∩ BIntersectionElements in both A and B
A − BDifferenceElements in A but not in B
B − ADifferenceElements in B but not in A
A △ BSymmetric DiffIn A or B but not both
A′ComplementElements in U but not in A
A × BCartesian ProductAll ordered pairs (a, b)
P(A)Power SetAll subsets of A
⚠️ Note
Cartesian product grows as |A| × |B|. Power set grows as 2ⁿ. For large sets, results may be long. Power set is limited to sets of ≤ 12 elements for performance.

What is Set Theory?

Set theory is a branch of mathematics that studies collections of objects called sets. A set is a well-defined collection of distinct elements. Set theory provides the foundation for most of modern mathematics and is used in logic, computer science, statistics, and probability. Georg Cantor developed modern set theory in the 1870s.

Set Theory Laws & Properties

LawUnionIntersection
IdentityA ∪ ∅ = AA ∩ U = A
ComplementA ∪ A′ = UA ∩ A′ = ∅
CommutativeA ∪ B = B ∪ AA ∩ B = B ∩ A
Associative(A∪B)∪C = A∪(B∪C)(A∩B)∩C = A∩(B∩C)
DistributiveA∪(B∩C) = (A∪B)∩(A∪C)A∩(B∪C) = (A∩B)∪(A∩C)
De Morgan's(A∪B)′ = A′∩B′(A∩B)′ = A′∪B′

Frequently Asked Questions

What is the difference between union and intersection?

The union (A ∪ B) contains every element that is in A, in B, or in both — it combines the sets. The intersection (A ∩ B) contains only the elements that appear in both A and B at the same time — it finds what they share. For example, if A = {1,2,3} and B = {3,4,5}: A∪B = {1,2,3,4,5} and A∩B = {3}.

What is a power set?

The power set P(A) is the set of all possible subsets of A, including the empty set ∅ and A itself. If A has n elements, P(A) has 2ⁿ subsets. For example, if A = {1, 2}, then P(A) = {∅, {1}, {2}, {1,2}} — 4 subsets (2² = 4).

What is the Cartesian product?

The Cartesian product A × B is the set of all ordered pairs (a, b) where a is from A and b is from B. If A = {1, 2} and B = {x, y}, then A × B = {(1,x), (1,y), (2,x), (2,y)}. The cardinality of A × B = |A| × |B|. It's used in coordinate geometry, databases, and probability.

What is the symmetric difference?

The symmetric difference (A △ B) contains elements that are in A or B but not in both — it's the union minus the intersection. It can also be written as (A − B) ∪ (B − A). For example, A = {1,2,3}, B = {2,3,4}: A △ B = {1,4}.

Related Calculators