Venn Diagram Calculator

Calculate Venn diagram regions for 2 or 3 sets. Find unions, intersections, complements, conditional probabilities, Jaccard similarity, and all exclusive regions with visual diagrams.

|A∪B| (union)
75
P(A∪B) = 75.00%
|A∩B| (intersection)
25
P(A∩B) = 25.00%
A only
35
In A but not B: 35.00%
B only
15
In B but not A: 15.00%
Neither
25
P(neither) = 25.00%
Symmetric Difference
50
In A or B but not both (XOR)
P(A|B)
62.50%
If in B, probability also in A
P(B|A)
41.67%
If in A, probability also in B

Venn Diagram

35
15
25
A (60)
B (40)
Neither: 25

Similarity Metrics

MetricValueFormulaInterpretation
Jaccard Index0.3333|A∩B| / |A∪B|Moderate overlap
Overlap Coeff.0.6250|A∩B| / min(|A|,|B|)Significant
Dice Coefficient0.50002|A∩B| / (|A|+|B|)Moderate
Lift1.0417Observed / ExpectedNear independent

Complete Region Breakdown

RegionCount% of UBar
A only3535.00%
B only1515.00%
A∩B2525.00%
Neither2525.00%
Planning notes, formulas, and examples

About the Venn Diagram Calculator

The Venn diagram calculator computes all region counts and probabilities for two or three overlapping sets inside a universal set. Enter the set sizes and intersections to get the exclusive regions, conditional probabilities, similarity metrics, and the full region breakdown.

For two sets, it calculates the union, intersection, symmetric difference, and several overlap metrics such as Jaccard and Dice. For three sets, it splits the diagram into all eight regions so you can see exactly how many elements fall into each combination.

That makes it useful for survey analysis, set-relationship exercises, and probability problems where overlap between events is the main thing you need to understand.

When This Page Helps

Venn diagrams are a compact way to see overlap, exclusion, and shared membership at the same time. This calculator keeps the bookkeeping out of the way so you can focus on what the regions mean.

It is most helpful when you need to decompose a problem into exclusive regions, compare set similarity, or translate set counts into probabilities.

How to Use the Inputs

  1. Select two-set or three-set mode.
  2. Enter the universal set size (total number of elements).
  3. Enter the size of each set (|A|, |B|, and optionally |C|).
  4. Enter intersection sizes: |A∩B|, and for three sets also |A∩C|, |B∩C|, |A∩B∩C|.
  5. Review the calculated regions, probabilities, and similarity metrics.
  6. Check for warnings about invalid inputs (negative regions indicate inconsistent sizes).
Formula used
|A∪B| = |A| + |B| − |A∩B|. A only = |A| − |A∩B|. Neither = |U| − |A∪B|. For three sets: |A∪B∪C| = |A| + |B| + |C| − |A∩B| − |A∩C| − |B∩C| + |A∩B∩C|.

Example Calculation

Result: Union = 75, A only = 35, B only = 15, Neither = 25

|A∪B| = 60 + 40 − 25 = 75. A only = 60 − 25 = 35 (in A but not B). B only = 40 − 25 = 15. Neither = 100 − 75 = 25. Jaccard similarity = 25/75 = 0.333 (moderate overlap).

Tips & Best Practices

  • If any region shows a negative count, your inputs are inconsistent — the intersection can't exceed either set size.
  • Jaccard index of 0 means no overlap; 1 means the sets are identical. Use it to compare set similarity.
  • Lift > 1 means positive association (sets overlap more than expected by chance); lift < 1 means negative association.
  • For three sets, enter intersections carefully — |A∩B| includes elements that are also in C. Use |A∩B| − |A∩B∩C| for the exclusive A∩B region.
  • The Dice and Jaccard coefficients are widely used in information retrieval and cluster analysis.
  • P(A|B) = |A∩B| / |B| — the conditional probability has a direct set interpretation.

Venn Diagrams in Data Science

In modern data science, Venn diagrams help visualize overlap between data clusters, feature sets, or model predictions. The Jaccard index is used as a loss function in image segmentation, the Dice coefficient in medical image analysis, and the overlap coefficient in gene set enrichment. Understanding these metrics starts with the Venn diagram framework.

Beyond Three Sets: Extra Complexity

Venn diagrams for 4+ sets exist but become complex — a 4-set diagram requires ellipses or non-circular shapes, and has 16 regions. For 5+ sets, the diagrams become impractical. This is why most practical applications use 2 or 3 sets and rely on tables or UpSet plots for higher dimensions.

De Morgan's Laws

De Morgan's laws connect complements of unions and intersections: (A∪B)ᶜ = Aᶜ∩Bᶜ and (A∩B)ᶜ = Aᶜ∪Bᶜ. On a Venn diagram, the complement of the union is the "neither" region, while the complement of the intersection is everything except the overlap. These laws extend to three or more sets.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • Union (A∪B) includes everything in A or B or both — it's the "or" operation. Intersection (A∩B) includes only elements in both A and B — it's the "and" operation. The Venn diagram shows union as both circles combined, intersection as only the overlap.