Set Theory Calculator

Enter your sets as comma-separated values, pick two or three sets, and get union, intersection, difference, complement, and more. The Venn diagram updates as you type.

Use commas. Duplicates are removed. Empty input means empty set.

A B C

Operations

  • A ∪ B (union)
  • A ∩ B (intersection)
  • A − B (difference)
  • A′ (complement)
  • A △ B (symmetric diff)
  • A × B (Cartesian, sample)

Properties

|A|
0
|B|
0
|C|
0
|U|
0
A ⊆ B
No
B ⊆ A
No
A ∩ B = ∅
No
A = B
No

Notation and operations at a glance

Sets are written as comma-separated elements; order and duplicates do not matter. Union (∪) is “in A or B or both”; intersection (∩) is “in both”; A − B is “in A but not in B”; A′ is everything in U that is not in A. Symmetric difference A △ B is (A − B) ∪ (B − A).

Relations you can read from the diagram

Subset A ⊆ B means every element of A is in B. Disjoint means A ∩ B = ∅. Equal sets have the same elements. Cardinality |A| is the number of elements. The tool uses the universal set U only for complement; other operations do not depend on U.

Where set theory shows up

  • Logic and Boolean algebra (AND, OR, NOT as intersection, union, complement)
  • Probability (sample spaces and events as sets)
  • Databases (relational algebra and SQL set-style operations)
  • Formal languages and automata