Home / Learn / Maths / Venn diagram calculatorTool #L89 (formerly #1186)

Venn diagram calculator: type (A ∪ B)′ ∩ C and see it shaded, check De Morgan's laws, count n(A ∪ B)

Type any set expression with union, intersection, complement and difference for 2 or 3 sets and see the region shaded on a Venn diagram. Compare two expressions to check De Morgan's laws, put in real lists of elements, and count with n(A ∪ B) = n(A) + n(B) − n(A ∩ B).

Keep it one tap away for everyday use.

Bookmark Venn diagram calculator?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Type sets
  2. Shaded
  3. Compare
  4. Count
Nothing is uploadedWorks offline once open

Type a set expression

You can also type u or | for ∪, n or & for ∩, ' for ′, and - for −. ′ is done first, then ∩, then ∪ and −; use brackets when in doubt.

Compare with another expression

Use my own elements

Try this

  • Shade (A ∪ B)′ and compare it with A′ ∩ B′: the same region. That is De Morgan's law.
  • Try A ∪ B ∩ C and (A ∪ B) ∩ C. Brackets matter.
  • Tick Put real elements in the sets and check that n(A ∪ B) = n(A) + n(B) − n(A ∩ B).
  • Switch to 2 sets and shade A − B, B − A and A Δ B (in exactly one of them).

Check yourself

Fresh numbers every time. Type a number or a fraction such as 3/4; nothing is saved or sent.

    What it does

    A Venn diagram draws each set as a circle inside a rectangle, the universal set U. The circles cut the rectangle into regions: 4 regions for two sets and 8 for three. Every set expression you can build from A, B and C, however long, is just a choice of some of those regions. This page reads the expression you type and shades exactly those regions, so you can see what (A ∪ B)′ ∩ C means.

    It also compares two expressions region by region (the quickest way to check a law such as De Morgan’s), and lets you fill the sets with real elements to work counting problems.

    It follows sets in Class 11 maths (operations on sets, complements, Venn diagrams and practical counting problems). For the same laws in logic, the logic simplifier simplifies true/false expressions; for counting arrangements and selections, see the combinatorics calculator; and the probability distribution explorer uses events and sets in probability.

    How to use it

    1. Choose 2 sets or 3 sets.
    2. Type an expression in the box, tap the symbol keys, or pick an example. You can type u or | for ∪, n or & for ∩, an apostrophe ’ for the complement ′, and a minus sign for the difference −. Δ is the symmetric difference.
    3. The diagram shades the set and the line under it names each shaded region, such as A ∩ B′ ∩ C (in A and C but not B).
    4. Compare: type a second expression. The page says whether the two are equal and, if not, which regions differ. The buttons fill in De Morgan’s two laws and the distributive law.
    5. Use my own elements: tick the box and type U, A, B (and C) as lists such as 1-12 or 2, 4, 6. Each region shows its elements, the result is written out in roster form, and the counting facts fill in with your numbers.

    Order of the signs

    The complement ′ is applied first, then ∩, then ∪, − and Δ from left to right, so A ∪ B ∩ C means A ∪ (B ∩ C). When in doubt, use brackets; the page shows how it read your expression in the heading above the diagram.

    Worked example

    Take U = {1, 2, …, 12}, A = {1, 2, 3, 4, 5, 6}, B = the even numbers and C = the multiples of 3. Then A ∪ B = {1, 2, 3, 4, 5, 6, 8, 10, 12}, so (A ∪ B)′ = {7, 9, 11} and (A ∪ B)′ ∩ C = {9}: one element, in the region A′ ∩ B′ ∩ C. Counting: n(A) = 6, n(B) = 6 and n(A ∩ B) = 3, so n(A ∪ B) = 6 + 6 − 3 = 9. For all three, n(A ∪ B ∪ C) = 6 + 6 + 4 − 3 − 2 − 2 + 1 = 10.

    De Morgan’s laws

    (A ∪ B)′ = A′ ∩ B′ and (A ∩ B)′ = A′ ∪ B′. Press the De Morgan buttons and both diagrams shade the same regions. Try the wrong version, A′ ∪ B′ for (A ∪ B)′, and the page lists the regions where they differ.

    Check yourself

    Five questions with fresh numbers: n(A ∪ B), a “neither” problem, De Morgan, three-set inclusion–exclusion and n(A − B). Nothing is saved.

    FAQ

    Why is my answer the empty set? Some expressions cover no region, such as A ∩ A′. The page says so and shades nothing.

    Can I use more than three sets? Not here: with four sets, circles can no longer show every region, which is why school problems stop at three.

    Is this from my textbook? It covers the standard school topic with its own examples. It is an independent study aid.

    Where the numbers come from

    • Standard set theory: union, intersection, complement, difference and symmetric difference, De Morgan's laws, the distributive laws and the inclusion–exclusion principle. Written for fibub; no textbook text, figures or exercises are used, and the example sets are made up.
    • Checked against Python's own set operations: the regions of 13 expressions on the eight regions of a three-set diagram, and results and counts on example lists of elements.

    Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

    Last updated 2026-11-09.

    Change log for Venn diagram calculator

    1. Add #1186 Venn diagram calculator Details on GitHub

    Every change to fibub

    Related tools

    Combinatorics calculator #T385 Count exactly, with every digit: permutations and combinations with or without repetition, multinomial coefficients (arrangements of a word), Stirling numbers of both kinds, Lah numbers, Bell and Catalan numbers, integer partitions and derangements, with tables you can download. Logic simplifier #T386 Type a Boolean expression or a list of minterms (with don't-cares) and get the truth table, the minimal sum of products and product of sums by Quine-McCluskey (up to 6 variables), a Karnaugh map with the groups circled (2 to 4 variables), the prime implicant chart and a logic gate diagram. Checked against sympy. Probability distribution explorer #T391 Pick a distribution (normal, t, chi-squared, F, beta, gamma, Weibull, binomial, Poisson and 26 more), set its parameters and see the curve with the probability between two values shaded, the quantiles, mean, variance, skewness and kurtosis, and draw seeded random samples. Matches scipy.stats. Probability tree #L94 Set P(A), P(B | A) and P(B | A′) with sliders and see the tree, the four path probabilities, P(B) by total probability, P(A | B) by Bayes' theorem and an independence check. 1000 dots show the same numbers as people, which makes it clear why a positive result on a test for something rare is often a false alarm. Relation checker #L96 Tap a table or type pairs to build a relation on {1, ..., n}, see it as an arrow diagram, and check reflexive, symmetric, transitive and antisymmetric with a counterexample for every no. Find equivalence classes, closures, and whether the relation is a one-one, onto function. Flowchart runner #L174 Pick a flowchart (even or odd, largest of three, add 1 to n, Euclid's HCF, leap year, steps to 1), type the inputs and follow it one box at a time. The current box lights up, the arrow taken is marked, and a trace table records every variable. Ends with predict-the-output questions. Power set builder #L232 Type a set of up to 6 elements and see every subset, from ∅ to the whole set, sorted by size with C(n, k) in each group. Switch elements in and out to build one subset and follow its path down a yes/no tree that shows why a set with n elements has 2ⁿ subsets. Event algebra #L240 Roll two dice (or a coin and a die) and see all the outcomes as a grid. Choose events A and B, shade them, outline A ∪ B, A ∩ B, A′, A − B or B − A, and watch the addition rule P(A ∪ B) = P(A) + P(B) − P(A ∩ B) worked out with the counts. Mutually exclusive and exhaustive events are flagged, and a simulation checks the answer. Logic gates #L281 Tap the inputs of an AND, OR, NOT, NAND, NOR, XOR or XNOR gate and watch the output lamp and its row of the truth table light up. Build NOT, AND and OR from NAND or NOR gates only, and chain two gates into a three-input circuit with its full truth table.