Venn diagrams are a clear way to see how groups overlap, and the counting behind them is simple. This Venn diagram calculator takes the total, the size of set A, the size of set B and the overlap to give the union, the number in only A, only B and neither, and the probabilities of A or B, A and B, and the conditional ones.
How the calculation works
- Union |A ∪ B| = |A| + |B| − |A ∩ B|. The overlap is counted twice when the two sets are added, so it is subtracted once.
- Only A = |A| − |A ∩ B|, and only B = |B| − |A ∩ B|. With the overlap, they make the three regions of the diagram.
- Neither = total − union, the elements outside both circles.
- Probabilities divide by the total. The probability of B given A is |A ∩ B| ÷ |A|, and the probability of A given B is |A ∩ B| ÷ |B|.
Example
Among 100 students, 60 like football (A), 45 like basketball (B) and 25 like both. The union is 60 + 45 − 25 = 80. Only football: 35, only basketball: 20, neither: 100 − 80 = 20. The probability of liking at least one is 80%, both 25%, basketball given football 25 ÷ 60 = 41.7%, and football given basketball 25 ÷ 45 = 55.6%.
Why it matters
Students, teachers, survey analysts and marketers use the counts to solve set problems, to read poll results and to check how audiences overlap. It is also an easy introduction to probability and to the inclusion-exclusion rule.
Good to know
The calculator handles two sets. Problems with three sets need an additional term for the triple overlap, and a different tool. The probabilities assume that every element in the universe is equally likely to be picked, and that the counts come from the same group. Real surveys also have non-response and rounding, so counts may not add up exactly. Check that the numbers are consistent before you use the percentages.
Related tools
The probability calculator handles chance events, the combinations calculator counts selections and the Bayes theorem calculator updates a probability with new evidence.