Set Theory Visualizer
Enter elements for each set and instantly see the result highlighted on an interactive Venn diagram. Explore union, intersection, complement, difference, symmetric difference, power set, and Cartesian product for 2 or 3 sets.
Set Inputs
Venn Diagram
Result
Set Properties
Reference Guide
Set Operations
A set is a well-defined collection of distinct objects called elements. The notation means x is an element of A; means it is not.
The symmetric difference contains elements in exactly one of the two sets. Two sets are disjoint when .
Venn Diagrams
A Venn diagram shows all possible logical relations between a finite collection of sets. Each circle represents a set; overlapping regions show shared elements.
For two sets A and B, there are four regions: only in A, only in B, in both (the intersection), and in neither (outside both, inside U). For three sets there are eight regions.
The complement contains everything in the universal set U that is not in A. In a Venn diagram it is the area outside circle A but inside the rectangle for U.
The power set is the set of all subsets of A. If , then . For A = {1, 2}, the power set has 4 elements: .
De Morgan's Laws
De Morgan's laws relate complements of unions and intersections. They are among the most useful identities in set theory and logic.
The first law says: everything outside the union is outside both sets. The second says: everything outside the intersection is outside at least one set.
These laws extend to any finite collection of sets and are the foundation of Boolean algebra and digital logic design (NOT(A OR B) = (NOT A) AND (NOT B)).
Inclusion-Exclusion Principle
The inclusion-exclusion principle counts elements in a union without double-counting those in intersections.
For three sets, each pairwise intersection is subtracted once, but the triple intersection was subtracted three times, so it must be added back once.
The Cartesian product is the set of all ordered pairs with the first from A and the second from B. Its cardinality is .