Venn Diagram Calculator
Paste two or three lists and get every Venn region: union, intersection, what is in only one set, and what falls outside all of them.
Venn Diagram Calculator
Background.
A Venn diagram calculator takes two or three lists and sorts every element into the region of the diagram where it belongs. Paste A = 1, 2, 3, 4, 5, 6 and B = 4, 5, 6, 7, 8 and C = 6, 7, 9, 10, and it reports that ten distinct elements appear somewhere, that only the element 6 sits in the centre where all three circles overlap, that three elements belong to A alone, one to B alone and two to C alone, and that three more sit in a two-way overlap. Those are the eight regions of a three-circle diagram, and getting them right by eye is exactly the sort of task people reliably fumble when the lists get past about a dozen entries.
In two-set mode the page is the complete set-algebra toolkit for a pair of lists. The union A ∪ B is everything that appears in either. The intersection A ∩ B is everything appearing in both. A only is the set difference A \ B, B only is B \ A, and the two crescents together are the symmetric difference A △ B. Every one of those is reported as a count and, where it helps, as an actual listing of the elements, so you can see which items are in the overlap rather than just how many there are. Choosing three sets swaps in the eight-region breakdown without changing anything about how the inputs work.
The optional universe box is what turns a diagram into a survey answer. Textbook problems almost always end with 'how many took neither', and that question is unanswerable from the two lists alone — you need to know how many people were in the room. Fill in the universe with every element under consideration and the calculator reports the outside region as |U| minus the size of the union. Leave it blank and the outside region is reported as zero, which is the honest answer: with no universe supplied, nothing is known to be outside. The calculator will not invent one. It does insist that a supplied universe actually contains everything you used in A, B and C, and names the offending element if it does not, because a universe that omits an element you have already placed inside a circle is a data-entry error rather than a legitimate configuration.
The arithmetic behind the counts is the principle of inclusion–exclusion, and the calculator's numbers can always be checked against it by hand. For two sets, |A ∪ B| = |A| + |B| − |A ∩ B|: add the sizes, then subtract the overlap once because adding both sizes counted it twice. For three sets the pattern continues — add the three sizes, subtract the three pairwise overlaps, then add the triple overlap back, because subtracting all three pairs removed the centre one time too many. On the worked example that reads 6 + 5 + 4 − 3 − 1 − 2 + 1 = 10, which is precisely the union size the page returns. A second, cleaner check is available too: the exclusive, two-way and three-way regions are disjoint and together they are the union, so 6 + 3 + 1 = 10 as well.
Element matching is exact text after trimming surrounding whitespace, which matters more than it sounds. It means 1 and 1.0 are two different elements and cat and Cat are two different elements, so a list of product codes or names compares the way you would expect rather than being silently normalised. It also means you can use anything at all as an element — words, phrases, coordinates, SKUs — not just numbers. Duplicates within a single list are collapsed, because a set holds each element once, and the order you type things in never changes a count; it only fixes the order the members are printed back in, which is first appearance scanning A, then B, then C.
The practical uses run well past homework. Comparing two exported lists to find what is in both, what only the first has, and what only the second has is the same computation as a two-circle Venn diagram, and it is faster here than in a spreadsheet. Three-set mode handles the classic survey and probability problems, the ones that give overlaps between three groups and ask for the count in exactly one of them.
What is venn diagram calculator?
A Venn diagram is a picture of the logical relationships between a small number of sets, drawn as overlapping closed curves so that every possible combination of membership and non-membership appears as its own region. John Venn introduced the construction in an 1880 paper in the Philosophical Magazine, generalising Euler's earlier circles by insisting that all 2^n combinations be represented whether or not any element happens to occupy them. That completeness is the defining property: with two sets there are four regions, with three sets eight, and each region corresponds to one row of the membership table. This calculator computes those regions from actual element lists rather than drawing them, reporting both the count in each region and, where useful, the members themselves.
How to use this calculator.
- Choose whether you are comparing two sets or three. Set C is ignored entirely in 2-set mode, so you can leave whatever is in it.
- Paste your lists into the Set A, Set B and Set C boxes, separating elements with commas, semicolons or new lines. Braces are optional and stripped.
- Leave the universe box blank if you only care about the circles. Fill it in with every element under consideration when you need the 'in none of them' count.
- Read the headline number: that is how many distinct elements appear in at least one set.
- Work outwards through the region counts — in every set, in exactly two, in exactly one, and the three individual crescents.
- Use the member listings when you need to know which elements are in a region rather than just how many. Listings stop after 40 elements.
- Check the arithmetic with inclusion–exclusion if you want: for two sets, |A| + |B| − |A ∩ B| must equal the union count.
The formula.
Every element that appears anywhere in your lists belongs to exactly one region of the diagram, determined by which circles contain it. The calculator builds the union first, then walks it once and, for each element, counts how many of the active sets contain it. An element in one set lands in that set's exclusive crescent; an element in two lands in a two-way overlap; an element in all of them lands in the centre. Because each element is classified exactly once, the region counts are disjoint and add up to the union size — which is the fastest way to check the output by hand.
The principle of inclusion–exclusion gives the same union count by a different route, and it is worth understanding because it is what survives when you have counts but not lists. Adding |A| and |B| counts every shared element twice, so subtracting |A ∩ B| once corrects it exactly: |A ∪ B| = |A| + |B| − |A ∩ B|. With three sets, adding the three sizes counts each pairwise-shared element twice and each triple-shared element three times. Subtracting the three pairwise intersections fixes the pairs but removes the centre three times, having added it three times, so the centre has vanished entirely — hence the final + |A ∩ B ∩ C| to restore it. The alternating pattern continues for any number of sets.
The 'exactly one' region is the symmetric difference when two sets are active: A △ B = (A \ B) ∪ (B \ A), the elements that belong to one list but not the other. It is the natural answer to 'what changed between these two exports'. With three sets active the same output means what it says — in exactly one of the three — which is not the same as any pairwise symmetric difference, so the page labels it by meaning rather than by symbol in three-set mode.
The outside region depends entirely on the universe, and this is the one place where the calculator refuses to guess. |U \ (A ∪ B ∪ C)| = |U| − |A ∪ B ∪ C| requires a U. With the universe box blank, the page reports the outside count as 0 and the universe is implicitly the union itself, which is the only assumption that adds no information. If you supply a universe, it must contain every element already placed in a circle; a universe that omits one is rejected with the offending element named, because that combination is not a meaningful configuration.
No rounding occurs anywhere on this page and no threshold decides anything. Every output is an exact count or an exact listing. Element identity is exact string equality after trimming leading and trailing whitespace — deliberately, because numeric coercion would silently merge 1 and 1.0 and case folding would silently merge cat and Cat, either of which would change a region count without telling you.
A worked example.
Take A = {1, 2, 3, 4, 5, 6}, B = {4, 5, 6, 7, 8} and C = {6, 7, 9, 10} in three-set mode, with the universe left blank. Start with the union. Scanning A gives 1 through 6; B adds 7 and 8, since 4, 5 and 6 are already there; C adds 9 and 10, since 6 and 7 are already there. So the union is {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} and the headline count is 10. Now place each element. The element 6 is the only one in all three lists, so the centre region holds exactly {6} and the intersection count is 1. Elements 4 and 5 are in A and B but not C; element 7 is in B and C but not A; nothing is in A and C without also being in B, because the only element A and C share is 6. That gives three elements in exactly two sets. Everything else sits in a single circle: 1, 2 and 3 in A alone, 8 in B alone, and 9 and 10 in C alone — six elements in exactly one set. The three tiers must account for the whole union, and they do: 6 in exactly one, plus 3 in exactly two, plus 1 in all three, is 10. That is the quickest hand check available and it is the one to run first when a result looks wrong. Inclusion–exclusion gives the same answer independently. The set sizes are 6, 5 and 4. The pairwise overlaps are |A ∩ B| = 3 (the elements 4, 5, 6), |A ∩ C| = 1 (just 6) and |B ∩ C| = 2 (6 and 7). The triple overlap is 1. So 6 + 5 + 4 − 3 − 1 − 2 + 1 = 10, matching the union count exactly. The outside region comes back as 0 because no universe was supplied — with nothing known beyond the three lists, nothing is known to be outside them. Had you entered a universe of 1 through 12, the two extra elements 11 and 12 would appear in no circle and the outside count would be 12 − 10 = 2. Switching to two-set mode with the same A and B, and ignoring C entirely, gives a smaller picture: the union becomes {1, …, 8} with 8 elements, the intersection is {4, 5, 6} with 3, A \ B is {1, 2, 3} with 3, and B \ A is {7, 8} with 2. The symmetric difference — in exactly one of the two — is 3 + 2 = 5, and inclusion–exclusion confirms the union as 6 + 5 − 3 = 8.
Frequently asked questions.
How do I calculate the union and intersection of two sets?
What does the inclusion–exclusion principle say?
Why is the 'in none of them' count zero?
How many regions does a three-set Venn diagram have?
What is the symmetric difference?
Can I use words or names as elements, not just numbers?
What happens to duplicates and to the order I type things in?
Does this calculator draw the diagram?
Why does the calculator reject my universe?
References& sources.
- [1]Weisstein, Eric W. "Inclusion-Exclusion Principle." MathWorld — Wolfram Research. Gives "|A union B| = |A| + |B| - |A intersection B|" and the alternating-sum extension, worked through a three-set example. This is the source for the union arithmetic on this page. Retrieved 2026-07-29.
- [2]Ruskey, Frank, and Mark Weston. "A Survey of Venn Diagrams", §"What is a Venn diagram?". The Electronic Journal of Combinatorics, Dynamic Survey DS5 — "Since each region is either inside or outside of a given curve, and there are n curves, there must be exactly 2^n regions in a Venn diagram (including the exterior…)", and "some authors refer to diagrams with fewer than 2^n regions as Venn diagrams, but they are more properly termed Euler diagrams". Open access; retrieved 2026-07-29.
- [3]Weisstein, Eric W. "Venn Diagram." MathWorld — Wolfram Research. Independently gives the region count as N = Σ(k=0..n) C(n,k) = 2^n, including the exterior region. Retrieved 2026-07-29.
- [4]Levin, Oscar. Discrete Mathematics: An Open Introduction, 3rd edition, §0.3 "Sets" — the definitions of subset, union, intersection and the empty set used throughout this page. Open access; retrieved 2026-07-29.
- [5]Venn, John. "On the diagrammatic and mechanical representation of propositions and reasonings." The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science 9 (1880): 1–18 — the originating paper. Volume number and page range as recorded independently by both MathWorld and the Ruskey–Weston survey bibliography; some modern bibliographies instead give 5th series, vol. 10, no. 59, a discrepancy this page does not attempt to resolve. The linked copy is a scanned facsimile and was not machine-readable at fetch time.
- [6]Halmos, Paul R. Naive Set Theory. Springer Undergraduate Texts in Mathematics, 1974 reprint of the 1960 Van Nostrand edition, §4 "Unions and Intersections" — the definitions of ∪ and ∩. Print reference, cited bibliographically; not retrieved during authoring.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 977 calculators remain free
- No billing is enabled