Venn Diagram Calculator (Three Sets, Inclusion–Exclusion)
How many are in at least one, in none, in exactly one or exactly two of three overlapping groups, and in each separate region of the Venn diagram.
Results
What this tool does
Adding the sizes of three overlapping sets counts anyone in two of them twice and anyone in all three three times, so the sizes of the pairwise overlaps are taken off and the triple overlap put back once: that is inclusion–exclusion. The trap in survey problems is that 'A and B' usually includes the people who are also in C; the calculator then peels the regions apart, so 'only A and B' is the pairwise overlap minus the triple one. If any region comes out negative, or the union is larger than the whole group, the numbers cannot all be true and the check says so. For two sets, leave C and every overlap that involves it at zero.
Formula
|A ∪ B ∪ C| = |A| + |B| + |C| − |A∩B| − |A∩C| − |B∩C| + |A∩B∩C| · only A = |A| − |A∩B| − |A∩C| + |A∩B∩C|
Variables
| Symbol | Meaning | Unit |
|---|---|---|
sa | Elements in set A | — |
sb | Elements in set B | — |
sc | Elements in set C (0 if only two sets) | — |
ab | In both A and B (including those also in C) | — |
ac | In both A and C (including those also in B) | — |
bc | In both B and C (including those also in A) | — |
abc | In all three sets | — |
nn | Everyone in the group (the universe) | — |
U | In at least one set | — |
NO | In none of the sets | — |
OA | Only in A | — |
OB | Only in B | — |
OC | Only in C | — |
OAB | In A and B but not C | — |
OAC | In A and C but not B | — |
OBC | In B and C but not A | — |
E1 | In exactly one set | — |
E2 | In exactly two sets | — |
OK | Do the numbers fit together? | — |
Worked example
- Elements in set A40
- Elements in set B35
- Elements in set C (0 if only two sets)30
- In both A and B (including those also in C)12
- In both A and C (including those also in B)10
- In both B and C (including those also in A)8
- In all three sets5
- Everyone in the group (the universe)100
- In at least one set80
- In none of the sets20
- Only in A23
- Only in B20
- Only in C17
- In A and B but not C7
- In A and C but not B5
- In B and C but not A3
- In exactly one set60
- In exactly two sets15
- Do the numbers fit together?Yes
Limitations
- The calculation runs at full precision and only the display is rounded. If you copy an intermediate value and retype it, small differences can appear.
- The default values are typical reference figures, not measurements of your situation. Replace them with your own data whenever you have it.