Venn Diagram Calculator

Quick answer

The Venn diagram calculator finds the size of every region of a two- or three-set Venn diagram (intersections, unions, differences, symmetric difference and complements) from the set sizes and known overlaps, using inclusion–exclusion, and draws the labelled diagram.

Union – in at least one set
37
Venn diagram
All regions and complements
Set Count Share of U ──────────────────────────────────────── A ∩ B (both) 8 16% A ∪ B (either) 37 74% A \ B (only A) 12 24% B \ A (only B) 17 34% A Δ B (exactly one) 29 58% A' (not A) 30 60% B' (not B) 25 50% (A ∪ B)' (neither) 13 26% (A ∩ B)' (not both) 42 84% (A \ B)' 38 76% (B \ A)' 33 66% (A Δ B)' 21 42%
Intersection |A ∩ B|
8
Only A
12
Only B
17
Symmetric difference |A Δ B|
29
In none of the sets
13
Share of U in at least one set
74 %
Share of U in both A and B – P(A ∩ B)
16 %
Share of A that is also in B – P(B | A)
40 %

A Venn diagram draws sets as overlapping circles inside a rectangle that stands for the universal set U. Each region of the picture is a different combination of memberships (only A, both A and B, neither), and its count is the number of elements with exactly that combination. Venn diagrams turn survey questions such as “how many students take neither French nor Spanish?” into simple arithmetic.

The key tool is the inclusion–exclusion principle. Adding |A| and |B| counts the overlap twice, so |A ∪ B| = |A| + |B| − |A ∩ B|. For three sets you subtract the three pairwise overlaps and add back the triple overlap. From the union, everything else follows: the elements outside all circles are |U| minus the union, “only A” is |A| minus the overlaps, and the symmetric difference (exactly one set) is the union minus the intersection.

For two sets, enter |U|, |A|, |B| and any one relation you know: the intersection, the union, A only, B only or the symmetric difference. For three sets enter the three pairwise intersections and the triple intersection. The calculator checks that the numbers are consistent and shows every region and complement, with each count as a share of U (which is also a probability if one element is picked at random).

How to use the Venn Diagram Calculator

  1. Number of sets
  2. Size of the universal set |U|
  3. Size of set A |A|
  4. Size of set B |B|
  5. Known relation
  6. |A ∩ B|
  7. |A ∪ B|
  8. |A B|
  9. |B A|
  10. |A Δ B|
  11. Size of set C |C|
  12. |A ∩ B|
  13. |A ∩ C|
  14. |B ∩ C|
  15. |A ∩ B ∩ C|

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

For two sets the intersection is recovered from whichever relation you give (for example |A ∩ B| = |A| + |B| − |A ∪ B|), then each region and complement is computed. For three sets the seven regions are found by inclusion–exclusion, starting with the triple overlap, then the “exactly two” regions, then the “only one” regions, and any negative region is reported as an inconsistency.

Worked example

In a group of 50 students, 20 study French (A), 25 study Spanish (B) and 8 study both. Then 20 − 8 = 12 study only French, 25 − 8 = 17 only Spanish, the union is 20 + 25 − 8 = 37, the symmetric difference (exactly one language) is 12 + 17 = 29, and 50 − 37 = 13 study neither. As shares of the group: 16% study both and 26% neither.

Add a third subject, German (C), with 18 students, where 6 also take French, 5 also take Spanish and 2 take all three. The union is 20 + 25 + 18 − 8 − 6 − 5 + 2 = 46, so 4 students take none. The regions are: only French 8, only Spanish 14, only German 9, French and Spanish only 6, French and German only 4, Spanish and German only 3, and all three 2.

Set notation cheat sheet

Notation Meaning Count (two sets)
A ∩ B in A and in B |A ∩ B|
A ∪ B in A or B (or both) |A| + |B| − |A ∩ B|
A B in A but not B |A| − |A ∩ B|
A Δ B in exactly one |A ∪ B| − |A ∩ B|
A′ not in A |U| − |A|
(A ∪ B)′ in neither |U| − |A ∪ B|

Formula

|A ∪ B| = |A| + |B| − |A ∩ B| · |A ∪ B ∪ C| = |A| + |B| + |C| − |A∩B| − |A∩C| − |B∩C| + |A∩B∩C| · |A Δ B| = |A ∪ B| − |A ∩ B| · |A′| = |U| − |A|

Worked example

Inputs: Number of sets: Two sets (A, B); Size of the universal set |U|: 50; Size of set A |A|: 20; Size of set B |B|: 25; Known relation: |A ∩ B| – in both; |A ∩ B|: 8.
Results: Union – in at least one set = 37; All regions and complements = Set Count Share of U
────────────────────────────────────────
A ∩ B (both) 8 16%
A ∪ B (either) 37 74%
A \ B (only A) 12 24%
B \ A (only B) 17 34%
A Δ B (exactly one) 29 58%
A' (not A) 30 60%
B' (not B) 25 50%
(A ∪ B)' (neither) 13 26%
(A ∩ B)' (not both) 42 84%
(A \ B)' 38 76%
(B \ A)' 33 66%
(A Δ B)' 21 42%; Intersection |A ∩ B| = 8; Only A = 12; Only B = 17; Symmetric difference |A Δ B| = 29.

Key terms

Universal set (U)
All the elements under consideration, shown as the rectangle around the circles.
Intersection (A ∩ B)
Elements in both A and B.
Union (A ∪ B)
Elements in A, in B or in both.
Set difference (A \ B)
Elements in A that are not in B.
Complement (A′)
Elements of U that are not in A.

Frequently asked questions

How do you find the union of two sets?

|A ∪ B| = |A| + |B| − |A ∩ B|. With |A| = 20, |B| = 25 and |A ∩ B| = 8, the union has 37 elements.

How do you find the intersection if you know the union?

Rearrange: |A ∩ B| = |A| + |B| − |A ∪ B|. 20 + 25 − 37 = 8.

What is the formula for three sets?

|A ∪ B ∪ C| = |A| + |B| + |C| − |A∩B| − |A∩C| − |B∩C| + |A∩B∩C|. With 20, 25, 18, 8, 6, 5 and 2 the union is 46.

What does A \ B mean?

The set difference: elements in A but not in B, |A| − |A ∩ B|. It is the "only A" crescent of the diagram.

What is the symmetric difference A Δ B?

Elements in exactly one of the two sets: |A ∪ B| − |A ∩ B|. For three sets, A Δ B Δ C contains the elements in an odd number of sets (one or three).

What is a complement?

Everything in U that is not in the set: |A′| = |U| − |A|. The elements in neither A nor B number |U| − |A ∪ B|.

Why does the calculator say my numbers are impossible?

Some region would be negative, for example an intersection larger than one of the sets, or a union bigger than U.

How do I turn region counts into probabilities?

Divide by |U|. 8 of 50 elements in both sets means P(A ∩ B) = 16%, and P(B | A) = 8 ÷ 20 = 40%.

Sources

  1. Wolfram MathWorld: Venn diagram
  2. Khan Academy: Statistics and probability
  3. OpenStax: Introductory Statistics 2e

Cite this calculator

Speedy Calculator. (2026). Venn Diagram Calculator. Speedy Calculator. https://speedycalculator.com/calculators/statistics/venn-diagram/

Embed this calculator on your website

Free for blogs, schools and businesses. Paste this code where the calculator should appear; it stays up to date automatically.