Home · Statistics · Probability & Combinatorics · Venn Diagram Calculator

Venn Diagram Calculator

The regions of a two-set Venn diagram from the sizes of the two sets, their overlap and the total: the union, each set alone, and the elements in neither set.

Your figures

Example result — edit the figures to make it yours

45

Only A20
Only B15
Both A and B10
Neither55
P(A or B)45%

What this calculator does

The regions of a two-set Venn diagram from the sizes of the two sets, their overlap and the total: the union, each set alone, and the elements in neither set. Every figure on this page is computed from the standard definition stated below — the same definition used in textbooks and reference tables — with no hidden rounding steps, and the method notes name the exact convention where more than one exists.

The formula and method

|A∪B| = |A| + |B| − |A∩B|

Inclusion–exclusion: the overlap is counted in both |A| and |B|, so it is subtracted once to get the union.

A only = |A| − |A∩B| and B only = |B| − |A∩B|; neither = total − |A∪B|.

The overlap cannot exceed either set's size, and the union cannot exceed the total.

Worked example

With the example inputs this page opens with (elements in a 30, elements in b 25, elements in both a and b 10, total elements 100), the result is 45. Change any figure and the result updates with the same formula.

Quick reference

Quick reference — varying elements in a
Elements in AResult
1530
2439
3045
37.553
4560
6075

Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.

Common questions

Why subtract the overlap when finding the union?

Elements in both sets are counted twice when |A| and |B| are added, once in each. Subtracting |A∩B| once counts every union element exactly once.

How do I find the elements in neither set?

Subtract the union from the total: 100 − 45 = 55 in the default example. Those elements sit outside both circles of the diagram.

How does the Venn Diagram Calculator work?

The regions of a two-set Venn diagram from the sizes of the two sets, their overlap and the total: the union, each set alone, and the elements in neither set. |A| · |B| · |A∩B| · Total elements → |A∪B| (in A or B). The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.

What inputs does the Venn Diagram Calculator need?

|A| · |B| · |A∩B| · Total elements → |A∪B| (in A or B). Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.