Venn diagram generator
Type a set expression and see its Venn diagram shaded, with every region listed as a row of a truth table. Or click the regions you want shaded and get the expression back. Name the sets, write items in the regions and download the diagram as an SVG or PNG.
Sets A B C. ∪ | + U union, ∩ & n intersection, A′ A' A^c ~A complement, − - \ difference, Δ xor symmetric difference, ∅ {} empty set, U ξ universal set. Brackets are safest; see the order of operations.
Click a region, or tab to it and press Enter, to shade or clear it. The expression updates to match.
- Expression
- A ∩ (B ∪ C)
- Shortest form
- A ∩ (B ∪ C)
- As a union of intersections
- (A ∩ B) ∪ (A ∩ C)
- Boolean algebra
- A ∧ (B ∨ C) Simplify Truth table
- Shaded regions (minterms)
- Σm(5, 6, 7)
Name the sets and add items
Names are drawn on the diagram; the expression keeps using the letters. Separate items with commas. A long list is shortened to fit its region. The link and the SVG and PNG downloads include both.
| Row | A | B | C | Region | In words | Shaded |
|---|---|---|---|---|---|---|
| m0 | 0 | 0 | 0 | A′ ∩ B′ ∩ C′ | Outside A, B and C | No |
| m1 | 0 | 0 | 1 | A′ ∩ B′ ∩ C | In C but not A or B | No |
| m2 | 0 | 1 | 0 | A′ ∩ B ∩ C′ | In B but not A or C | No |
| m3 | 0 | 1 | 1 | A′ ∩ B ∩ C | In B and C but not A | No |
| m4 | 1 | 0 | 0 | A ∩ B′ ∩ C′ | In A but not B or C | No |
| m5 | 1 | 0 | 1 | A ∩ B′ ∩ C | In A and C but not B | Yes |
| m6 | 1 | 1 | 0 | A ∩ B ∩ C′ | In A and B but not C | Yes |
| m7 | 1 | 1 | 1 | A ∩ B ∩ C | In A, B and C | Yes |
How to shade a Venn diagram, step by step
Work from the inside out, as with arithmetic: shade the innermost brackets first, then combine. Each diagram below is one step of A ∩ (B ∪ C), and it changes with the expression above.
-
1 B ∪ C
Shade every region in B or C, or both.
-
2 A ∩ (B ∪ C)
Keep only the regions shaded in both A and B ∪ C.
For an intersection, a region is shaded only if it is shaded in both parts. For a union, if it is shaded in either. A complement swaps shaded and unshaded, including the region outside every circle.
Printable set operations chart
The eight common two-set operations as shaded Venn diagrams, each drawn by the same engine as the generator, for printing or a worksheet.
Click to download: Set operations Venn diagram chart
Venn diagrams and truth tables
A point of the diagram is either in A or not, in B or not, in C or not. That is three yes-or-no answers, like three variables that are each 1 or 0, so the eight regions of a three-set diagram are exactly the eight rows of a three-variable truth table. Each region is one minterm.
| A | B | C | Region | Minterm |
|---|---|---|---|---|
| 0 | 0 | 0 | A′ ∩ B′ ∩ C′ | m0 |
| 0 | 0 | 1 | A′ ∩ B′ ∩ C | m1 |
| 0 | 1 | 0 | A′ ∩ B ∩ C′ | m2 |
| 0 | 1 | 1 | A′ ∩ B ∩ C | m3 |
| 1 | 0 | 0 | A ∩ B′ ∩ C′ | m4 |
| 1 | 0 | 1 | A ∩ B′ ∩ C | m5 |
| 1 | 1 | 0 | A ∩ B ∩ C′ | m6 |
| 1 | 1 | 1 | A ∩ B ∩ C | m7 |
So shading a Venn diagram and filling in the output column of a truth table are the same job. Union is OR, intersection is AND and complement is NOT, which is why the generator can hand every expression to the truth table generator and the boolean algebra calculator. The symbols are listed side by side on the set notation page.
De Morgan's laws for sets
The complement of a union is the intersection of the complements, and the other way round. Shade both sides and the diagrams come out identical.
Outside the union is outside both. Same regions in both, checked by the engine.
Outside the overlap is outside at least one. Same regions in both, checked by the engine.
A common slip is to complement each set and keep the operator: (A ∪ B)′ is not A′ ∪ B′, which shades everything except the overlap. Shade it. The same laws for logic gates are on De Morgan's laws.
Venn diagrams and Karnaugh maps
A Karnaugh map is a Venn diagram with square regions. Each cell is one region, laid out so that neighbouring cells differ in one set, which makes the groups easy to see. Here is A ∩ (B ∪ C) as a map:
| A \ BC | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0m0 | 0m1 | 0m3 | 0m2 |
| 1 | 0m4 | 1m5 | 1m7 | 1m6 |
The labels match: region m5 of the diagram, A ∩ B′ ∩ C, is cell m5 of the map. Past three sets circles run out of room, and a map keeps going: the Karnaugh map solver handles up to six variables.
Questions
How do I type the set symbols?
Union: ∪, |, + or the word union, or a U between two sets (A U B). Intersection: ∩, &, n or intersect. Complement: A′, A', Aᶜ, A^c, ~A or not A. Difference: −, - or \. Symmetric difference: Δ, ⊕ or xor. Use ∅ or {} for the empty set and U or ξ for the universal set. The sets are A, B and C; lowercase works too.
Which operation comes first without brackets?
Here complement binds tightest, then intersection, then difference and symmetric difference (left to right), then union, so A ∪ B ∩ C means A ∪ (B ∩ C). Textbooks do not all agree on this order, so write the brackets. The generator always prints them in its answers, so they never depend on a convention.
Why does U mean both union and the universal set?
Because people type it for both, and the position always tells them apart. Between two sets, as in A U B, it can only be a union. Where a set is expected, as in U − A or A ∩ U, it is the universal set. For an unambiguous answer, use ∪ for union and U or ξ for the universal set.
How do I get the expression for a shaded diagram?
Click the regions. Each click shades or clears one region, and the expression box is rewritten with the shortest expression that shades exactly those regions. Clear shading starts from an empty diagram. With the keyboard, tab to a region and press Enter or Space.
How is the shortest expression found?
By search, not guesswork. For up to three sets there are only 256 possible shadings, so the generator builds every expression in order of length until each shading has one, counting every set and operator. The union of intersections next to it comes from the Quine-McCluskey method, the same minimisation the Karnaugh map solver uses.
How many regions does a Venn diagram have?
Two to the power of the number of sets, counting the region outside every circle: 2 for one set, 4 for two and 8 for three. Each region is one row of the truth table, because each set is either in or out, just as each variable is either 1 or 0.
Can I name the sets and put items in the regions?
Yes. Open "Name the sets and add items" under the diagram. A name such as Cats replaces the letter on the diagram, while the expression keeps using A, B and C. Type the items of each region separated by commas, and they are drawn inside it; a long list is shortened to fit, ending in a count of what is left out. The names and items are part of the link and of the SVG and PNG downloads.
Can I draw four sets?
Not here. Four circles cannot show all 16 regions, since some combinations would be missing; a four-set Venn diagram needs ellipses or other shapes. For four or more variables a Karnaugh map is easier to read, and the Karnaugh map solver goes up to six.