Venn Diagram Calculator - Union, Intersection & Difference
Solve 2-set and 3-set Venn diagram problems instantly — find union, intersection, exclusive regions, and differences from any set totals.
Select 2 or 3 sets, enter the total elements in each set and their intersections, then click Calculate to see every region of the Venn diagram.
Venn Diagram Calculator - Union, Intersection & Difference
Solve 2-set and 3-set Venn diagram problems instantly — find union, intersection, exclusive regions, and differences from any set totals.
About the Venn diagram calculator
A Venn diagram is a visual representation of the relationships between two or more sets. Circles (or ellipses) are drawn so that their overlapping regions correspond to elements that belong to multiple sets simultaneously. Venn diagrams were introduced by the English logician John Venn in 1880 and have since become one of the most widely used tools in mathematics, logic, statistics, computer science, linguistics, and everyday reasoning.
For a 2-set Venn diagram, three regions matter: elements that belong only to A, elements that belong only to B, and elements in the intersection A ∩ B that belong to both. The union A ∪ B is the total count of distinct elements in either set, calculated as |A| + |B| − |A ∩ B|. Subtracting the intersection avoids double-counting the elements that appear in both circles. This formula underlies the inclusion-exclusion principle, which generalises to any number of sets.
For a 3-set Venn diagram, seven distinct regions appear: elements exclusive to A, elements exclusive to B, elements exclusive to C, elements in A ∩ B but not C, elements in A ∩ C but not B, elements in B ∩ C but not A, and elements in the central triple intersection A ∩ B ∩ C. The 3-set union formula is |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|. The triple intersection is added back in because it was subtracted three times (once for each pairwise intersection) after being added three times (once for each set), so it needs to be restored exactly once.
Practical applications of Venn diagrams are everywhere. Survey analysts use them to decompose audiences: how many respondents use platform A only, platform B only, or both? Database engineers use set operations — UNION, INTERSECT, EXCEPT — that map directly to Venn regions. Medical researchers use them to analyse how many patients exhibit symptom A, symptom B, or both. Educators use them to compare and contrast concepts. Market researchers use them to understand brand overlap. In probability theory, the Venn diagram makes the addition rule — P(A ∪ B) = P(A) + P(B) − P(A ∩ B) — immediately visual and intuitive.
This calculator validates the inputs before computing: it checks that no intersection exceeds the size of its component sets, that the triple intersection does not exceed any pairwise intersection, and that all values are non-negative. If the inputs are consistent, every region of the diagram is computed and displayed in a clear table.
Venn diagram examples
Three realistic scenarios — two 2-set and one 3-set — demonstrating the calculator's output.
| Input | Union | Details |
|---|---|---|
| 2-set: A=40 (basketball), B=30 (tennis), A∩B=10 | A ∪ B = 60 | A only = 30, B only = 20, both = 10. Sixty distinct students play at least one sport. |
| 2-set: A=150 (fiction), B=100 (non-fiction), A∩B=75 | A ∪ B = 175 | A only = 75, B only = 25, both = 75. Of 175 readers, 75 read both genres — a large overlap. |
| 3-set: A=60, B=50, C=40, A∩B=30, A∩C=20, B∩C=15, A∩B∩C=5 | A ∪ B ∪ C = 90 | Central region = 5 people use all three platforms. A∩B only = 25, A∩C only = 15, B∩C only = 10. |
How to use the Venn diagram calculator
- Choose 2 Sets or 3 Sets depending on how many groups you need to analyse.
- Enter the total number of elements in each set (A, B, and optionally C).
- Enter the intersection values: A ∩ B for 2 sets, or A ∩ B, A ∩ C, B ∩ C, and A ∩ B ∩ C for 3 sets.
- Click Calculate to see every exclusive region and the overall union.
- Use the example buttons below the table to load realistic survey or social data sets instantly.
Venn diagram FAQ
What is a Venn diagram?
A Venn diagram uses overlapping circles to show the logical relationships between sets. The overlap between two circles represents elements shared by both sets (intersection), while the non-overlapping parts represent elements belonging to only one set (exclusive regions).
What is the formula for the union of two sets?
The union |A ∪ B| = |A| + |B| − |A ∩ B|. You must subtract the intersection because those elements are counted once in |A| and once in |B|; subtracting |A ∩ B| removes the double count so each element is counted exactly once.
How does the 3-set union formula work?
For three sets: |A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|. Each element is added three times (once per set), pairwise intersections are each subtracted once, but this over-subtracts the triple intersection by one, so it must be added back.
What does 'exclusive to A' mean?
Elements exclusive to A belong to set A but not to any other set. In a 2-set diagram, A only = |A| − |A ∩ B|. In a 3-set diagram, A only = |A| − |A ∩ B| − |A ∩ C| + |A ∩ B ∩ C|, adding back the triple intersection that was removed twice.
Why does the calculator reject some input combinations?
The intersection of two sets cannot be larger than either set alone, since the intersection is a subset of both. Similarly, the triple intersection cannot exceed any pairwise intersection. The calculator enforces these constraints to prevent mathematically impossible configurations.