Venn Diagram Calculator
Solve two set questions with a Venn diagram calculator. Enter sizes for U, A, B, and differences to compute intersections and unions quickly.
Enter the Details
Result will appear here...
What the Venn diagram calculator does
A Venn diagram splits a group of things into overlapping sets, and the interesting question is usually how many items fall in each region. This calculator works those counts out. From the size of the whole group and a few facts about two sets A and B, it finds the size of every region: what is in both, in one but not the other, in either, and in neither.
It turns a handful of known totals into the full set of counts a two-circle Venn diagram describes. Below is how it works and what each region means.
How to use it
- Enter the size of the universal set, the total number of items in the whole group.
- Enter the size of set A, the size of set B, and the size of A minus B, the part of A that is not in B.
- Press Calculate for the size of every region, or Reset to clear it.
The regions of a two-set diagram
Two overlapping circles inside a box carve the whole group into four regions. There is the part in both A and B, the lens where the circles overlap. There is the part in A only and the part in B only, the crescents on each side. And there is the part in neither, the space in the box outside both circles.
Every item in the group lands in exactly one of these four regions, and their four counts add up to the size of the whole group. That is the structure the calculator fills in, giving you each piece from the totals you already know.
How the regions are worked out
The key is that the overlap can be found by subtraction. If you know the size of A and the size of the part of A that is not in B, then the part of A that is in B, the overlap, is simply the difference:
Items in both = size of A minus the part of A not in B
Once the overlap is known, the rest follows. The part of B only is the size of B minus the overlap. The union, everything in either set, is the two sizes added with the overlap subtracted once so it is not counted twice. And the part in neither is the whole group minus the union. Each region is a short step from the last.
The set operations it reports
Alongside the plain regions, the calculator reports the named set operations built from them. The union, written A or B, is everything in either set. The intersection, A and B, is the overlap. The symmetric difference is everything in exactly one set but not both, the two crescents together.
It also gives the complement of each, the items outside a given set or region. The complement of A is everything not in A, the complement of the union is the part in neither, and so on. These are the standard vocabulary of set theory, and having every one counted lets you answer almost any question about how the two sets divide the group.
A worked example
Suppose a group of 100 people includes 30 who like tea (set A) and 25 who like coffee (set B), and 20 of the tea drinkers do not like coffee, so A minus B is 20.
The overlap, people who like both, is 30 minus 20 = 10. Coffee only is 25 minus 10 = 15. The union, people who like either, is 30 plus 25 minus 10 = 45, and the part in neither is 100 minus 45 = 55. Those four regions, 20 tea only, 10 both, 15 coffee only, and 55 neither, add back to the full 100, which is the check that it all fits together.
Entering your values
Enter whole-number counts: the universal set size, the sizes of A and B, and the size of A minus B. For the numbers to make sense, the parts should fit inside their wholes, so A minus B cannot exceed A, and A and B cannot exceed the universal set. The calculator returns the count for every region and set operation.
Questions people ask
What is a Venn diagram?
A picture of how sets overlap, drawn as circles inside a box. It splits a group into regions: in both sets, in one only, or in neither.
How is the overlap found?
By subtracting the part of A that is not in B from the size of A. What remains is the part of A that is also in B, which is the overlap.
What is the difference between union and intersection?
The union is everything in either set, found by adding the sizes and subtracting the overlap. The intersection is only the overlap, the part in both sets.
How do I check the counts are right?
The four regions, both, A only, B only, and neither, should add up to the size of the whole group. If they do not, one of the inputs is off.
References
A quick note on where the methods here come from. Set operations, unions, intersections, and complements, are foundational to probability and are set out in the NIST/SEMATECH e-Handbook of Statistical Methods, the US government's public statistics reference. OpenStax Introductory Statistics is a free, widely used textbook covering sets and Venn diagrams in probability.
- NIST/SEMATECH e-Handbook of Statistical Methods (probability and sets). https://www.itl.nist.gov/div898/handbook/
- OpenStax, Introductory Statistics (Venn diagrams and set operations in probability). https://openstax.org/details/books/introductory-statistics-2e
Ankit Khatiwada is a researcher and graduate student in Computer Science at Saarland University, with strengths in statistics, data analysis, data engineering, and full stack development. His work sits at the intersection of quantitative reasoning and applied technology, making him a strong fit for tools that depend on clear numerical logic. At Eon Tools, he reviews number and statistical tools.
Other Tools
- A/B Test Calculator
- Accuracy Calculator
- Beta Function Calculator
- Central Limit Theorem Calculator
- Chebyshev'S Theorem Calculator
- Constant Of Proportionality Calculator
- Empirical Rule Calculator
- Least To Greatest Calculator
- Pie Chart Calculator
- Point Estimate Calculator
- Sample Ratio Mismatch Calculator
- Weighted Mean Calculator