Advertisement
Advertisement
SET THEORY

Venn Diagram Calculator — region counts for two or three sets

Enter set totals and intersections, and get every region of the Venn diagram counted, checked for consistency, and drawn.

The total population everything is drawn from. Used only to count what falls outside every set. Set it to 0 to ignore it.
The full overlap of A and B, including anything that is also in C.
Elements in at least one set
0
 
0
In exactly one set
0
In exactly two sets
0
In all three sets
0
Outside every set
Tip: the intersection inputs are the full overlaps, not the exclusive slices. |A ∩ B| includes any element that also happens to be in C, which is exactly why the triple overlap gets subtracted back out.
Advertisement

This Venn diagram calculator takes the set totals and intersection sizes you know, works out how many elements fall in every individual region of a two- or three-set diagram, and draws the diagram with each region labelled. It also checks the numbers for consistency, because a surprising proportion of textbook and survey data implies a region with a negative number of elements in it.

Arb Digital publishes it because the arithmetic behind a Venn diagram is the inclusion-exclusion principle, and inclusion-exclusion is one of those results that is obvious for two sets and quietly error-prone for three. The alternating pattern of adding and subtracting is easy to state and easy to misapply, and seeing the regions drawn is what makes it click.

What This Venn Diagram Calculator Does

You supply the sizes of the sets and their pairwise and triple intersections. It returns the seven disjoint regions of a three-set diagram, or the three of a two-set diagram, plus the size of the union, the count outside every set, and totals grouped by how many sets an element belongs to. The diagram is generated as inline SVG from your numbers, so the labels are the actual counts rather than a stock illustration.

It is a counting tool rather than a probability tool. If your inputs are probabilities and you want conditional or compound results, our probability calculator and conditional probability calculator are the right pages. The boundary is that this one deals in cardinalities — how many elements — and leaves the interpretation to you. For the related business of counting arrangements rather than memberships, see the permutation calculator.

How to Use It

  1. Choose two or three sets. The three-set inputs disappear in two-set mode so there is nothing spare to fill in.
  2. Enter the set totals. |A| is everything in A, including the parts shared with B and C.
  3. Enter the full intersections. |A ∩ B| is every element in both A and B, whether or not it is also in C. This is the input people most often get wrong.
  4. Enter the triple intersection in three-set mode. If nothing lies in all three, enter zero rather than leaving it blank.
  5. Set |U| if you have one. It only affects the count outside every set, and a value of zero simply suppresses that figure.

The Formula and How It's Calculated

The union comes from the inclusion-exclusion principle. For two sets, |A ∪ B| = |A| + |B| − |A ∩ B|: adding the two totals counts the overlap twice, so it is subtracted once. For three sets, |A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|. The triple term returns because subtracting all three pairwise overlaps removes the centre three times after it was added three times, leaving it at zero.

The individual regions then come from peeling the shared parts off each total. The centre region is just |A ∩ B ∩ C|. Each exclusive pairwise region is its pairwise intersection minus the centre. Each exclusive single region is |A| − |A ∩ B| − |A ∩ C| + |A ∩ B ∩ C|, which is inclusion-exclusion applied one set at a time.

Work the defaults through. With |A| = 40, |B| = 35, |C| = 30, |A ∩ B| = 15, |A ∩ C| = 12, |B ∩ C| = 10 and |A ∩ B ∩ C| = 5, the centre is 5. The exclusive pairs are 15 − 5 = 10, 12 − 5 = 7 and 10 − 5 = 5. A alone is 40 − 15 − 12 + 5 = 18, B alone is 35 − 15 − 10 + 5 = 15, and C alone is 30 − 12 − 10 + 5 = 13. Those seven regions sum to 73, which matches the union from the formula: 40 + 35 + 30 − 15 − 12 − 10 + 5 = 73. With |U| = 100, that leaves 27 outside every set. The LibreTexts section on inclusion-exclusion derives the general alternating form and works the same kind of example.

Advertisement

Why Consistency Checking Matters More Than the Arithmetic

Venn data is over-determined. Seven region counts are being reconstructed from seven inputs, and unlike most reconstructions this one has hard constraints: no region can be negative. When a region comes out below zero, the input data cannot describe any real collection of objects, and this tool says so rather than printing an impossible diagram.

The constraints are worth knowing because they tell you where the error is. Every pairwise intersection must be at least as large as the triple intersection, since anything in all three sets is necessarily in each pair. Each set total must be at least the sum of its two pairwise overlaps minus the triple. And no intersection can exceed the smaller of the two sets it joins. A failure of the first is usually a data-entry slip; a failure of the second usually means someone reported exclusive overlaps where the full ones were wanted.

That last confusion is the most common by far. If a survey reports "15 people used both A and B" it is often reporting the exclusive count — people who used A and B but not C. Feeding an exclusive figure into a field expecting the full intersection makes the single regions too large and the total too big. If you have exclusive figures, add the triple count back onto each pairwise figure before entering it.

Reading the Diagram, and What It Cannot Show

The generated diagram uses three equal circles in the standard symmetric arrangement, which produces exactly seven bounded regions plus the outside. That arrangement is chosen for legibility, not proportionality: the circles are the same size regardless of your set sizes, and the drawn areas are not to scale. A region containing one element is drawn the same size as one containing five hundred, with the count printed inside it.

Proportional versions of this diagram do exist and are called area-proportional or Euler diagrams, but for three sets they frequently have no exact solution — there is often no arrangement of three circles whose overlap areas match arbitrary counts. That is a genuine geometric limitation rather than a rendering shortcut, and it is why almost every published three-set Venn diagram uses equal circles with labels.

Four sets break the picture entirely. Four circles cannot produce all fifteen required regions, which is why four-set Venn diagrams are drawn with ellipses and become hard to read immediately. Beyond four, the diagram stops being a useful way to think, though the inclusion-exclusion arithmetic carries on working for any number of sets with the same alternating pattern of signs.

Where This Turns Up Outside the Classroom

Any question of the form "how many are in at least one of these groups" is inclusion-exclusion. Audience overlap across channels is the obvious commercial case: three campaigns each reached a known number of people, the pairwise overlaps are known from matching, and the genuinely distinct reach is the union rather than the sum. Adding the three reach figures together overstates the audience by exactly the amount inclusion-exclusion removes.

The same structure appears in counting problems with divisibility, in database record matching, and in survey analysis where respondents can choose several options. The one thing all these share is that the naive total is always too large and never too small, because double-counting only ever adds. If you are then converting counts into likelihoods, the probability calculator takes over, and Penn State's STAT 500 course notes connect the set-theory rules to the probability axioms they underpin. For counting problems built on combinations rather than overlaps, the binomial coefficient calculator and factorial calculator are the tools that follow.

Counting your real audience rather than the sum of your channels?

Arb Digital measures overlap before it reports reach, which is the difference between a number and a defensible number.

Browse All Free Tools Talk To Our Team

Common Mistakes to Avoid

  • Entering exclusive overlaps as full ones — |A ∩ B| must include elements that are also in C, or every other region comes out wrong.
  • Forgetting to add the triple intersection back — subtracting all three pairwise overlaps removes the centre entirely, so it has to return.
  • Ignoring a negative region — it is not a rounding artefact. It means the inputs describe no possible collection and one of them is wrong.
  • Reading the drawn areas as proportional — the circles are equal by construction, and only the printed counts carry information.
  • Summing set totals to get reach — the sum double-counts every overlap, which is the whole reason inclusion-exclusion exists.

Related Free Tools From Arb Digital

Work with likelihoods using the probability calculator, condition on an event with the conditional probability calculator, count ordered arrangements with the permutation calculator, count unordered selections with the binomial coefficient calculator, expand a factorial with the factorial calculator, or evaluate logical expressions with the truth table generator. The full free online tools hub lists every maths and statistics tool we publish.

Frequently Asked Questions

How do I calculate the regions of a Venn diagram?

Start from the centre and work outwards. The triple intersection is given, each exclusive pairwise region is its pairwise intersection minus the triple, and each exclusive single region is the set total minus both of its pairwise overlaps plus the triple.

What is the inclusion-exclusion principle?

A counting rule for the size of a union. Add the individual sets, subtract every pairwise intersection, add back every triple intersection, and continue alternating signs for larger groups.

Does the intersection input include the triple overlap?

Yes. Enter the full intersection of the two sets, including any elements that also belong to the third. The calculator subtracts the triple overlap itself where the arithmetic requires it.

Why does the calculator say my numbers are inconsistent?

Because at least one region came out negative, which no real collection can produce. Usually a pairwise intersection is smaller than the triple intersection, or a set total is smaller than the overlaps claimed for it.

Are the circles drawn to scale?

No. The three circles are equal and arranged symmetrically so that all seven regions are visible and labelled. Area-proportional diagrams often have no exact solution for three sets of arbitrary sizes.

Can this handle four or more sets?

Not as a diagram. Four circles cannot produce the fifteen regions four sets require, which is why four-set diagrams use ellipses. The inclusion-exclusion arithmetic itself extends to any number of sets.

What is the universal set used for?

Only to work out how many elements fall outside every set, which is the universal set size minus the union. Leaving it at zero simply omits that figure from the results.

This page performs set-theory counting for educational purposes only. Whether your input figures describe the population you think they do is a question about your data, not about the arithmetic.

Advertisement
Advertisement

Take it further