Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Venn Diagram and Truth Table Explorer


How to use
  1. Type a set expression into the Expression box, or build it from the symbol buttons: the set letters, then \cap, \cup, \setminus, \oplus, the complement mark, brackets, \emptyset and UU.
  2. The 2 sets and 3 sets buttons rebuild both views at that size. Two sets give 4 regions and 4 rows; three sets give 8 of each.
  3. The counter beside the Expression heading reads how many regions the expression shades out of the total.
  4. As sets and As logic show the same expression in both alphabets, rewritten live as you type.
  5. The preset buttons load standard expressions, including AAcA \cup A^c and AAcA \cap A^c — the tautology and the contradiction.
  6. The Regions panel shades every region the expression is true on, and its heading shows the result column as a string of ones and zeros.
  7. The Truth table panel lists one row per region: which sets the point is inside, then whether the expression holds there.
  8. Click any row, or any region of the diagram, and the matching one on the other side is outlined. Click it again to deselect.
  9. The key under the table pairs each set symbol with its logical twin: \cap with \wedge, \cup with \vee, \oplus with exclusive or, and the complement mark with negation.
  10. The panel below both views names what you are looking at — a tautology, a contradiction, a named connective, or an expression that ignores one of its sets.


Expression

1/4
As sets
A ∩ B
As logic
A ∧ B

Regions

0001
AB

Click a region to select the row that describes it.

Truth table

4 rows
RegionABResult
A∩BTTT
BFTF
ATFF
UFFF
=conjunction
=disjunction
=exclusive or
=falsity
U=truth
=¬negation

This is conjunction

The result column is 00010001, which is exactly the column for AND.

Written as sets it is ABA ∩ B. Written as logic it is ABA ∧ B. Same column, same regions, two notations.

That correspondence is not a coincidence or an analogy. Intersection is conjunction, union is disjunction, complement is negation — and every set identity you can prove is a logical equivalence you have already proved, and the other way round.
Set notation and logic notation developed separately and still look nothing alike, yet they describe one Boolean algebra and translate mechanically either way. Learn more about named columns · The named connectives






Getting Started

The tool holds one expression and draws it twice, so the first thing to do is give it an expression.

Type into the Expression box, or assemble it from the symbol buttons underneath: the set letters first, then the operators — intersection, union, difference, symmetric difference, the complement mark, brackets, the empty set and the universe.

Two choices shape everything else:

• The 2 sets and 3 sets buttons rebuild both views. Two sets give 4 regions and 4 rows; three sets give 8 of each.
• The preset buttons load standard expressions, which is the quickest way to see the tool work before typing anything of your own.

Watch two readouts as you type. The counter beside the Expression heading says how many regions are shaded out of the total, and the As sets and As logic lines rewrite your expression into logical notation as you go.

If the expression will not parse the box turns red and the reason appears below it. Unclosed brackets account for most of these.

Before typing anything the tool sits in its empty state, which is worth a look on its own: the diagram is drawn, the table is built, and only the answer is missing.

An Empty Expression Box

With no expression typed, both views are already built: the circles are drawn, the regions exist, the table has its rows. Only the answer is missing, and nothing is shaded.
AB
No expression yet, frozen

The regions exist before any expression does. Typing one only decides which of them get shaded.

This state is worth a moment because it shows what the diagram is before any expression acts on it. The regions are not created by the expression — they are created by the sets, and there are 2n2^n of them whatever you eventually type.

An expression does one thing only: it selects. It answers true or false for each region, and the shading is that answer painted on. The same is true of the table, which already has its rows and only wants a Result column.

Seeing the empty case makes the later ones easier to read. Every region shaded and no region shaded are the two extremes of that selection, and everything else lies between them.

Reading the Two Views

The Regions panel on the left and the Truth table on the right are not an illustration and its explanation. They are the same object written twice.

A region of the diagram is a decision about each set: inside or outside. A row of the table is a decision about each set: true or false. With nn sets there are 2n2^n of each, and they are the same 2n2^n decisions in a different alphabet.

So the shaded regions are exactly the true rows. The heading of the Regions panel prints the result column as a string of ones and zeros — the signature of the expression — and reading it left to right walks the table top to bottom.

The table columns are the sets, in order, followed by the Result column. The Region column names each row the way set notation would: an intersection of the sets the point lies in, or the universe symbol for the region outside everything.

Two expressions are equal exactly when their result columns match, which is the whole basis of checking an identity here. An ordinary mixed column shows the correspondence at its plainest.

An Ordinary Mixed Column

A(BC)A \cap (B \cup C) on three sets shades three regions of the eight: the parts of AA that meet BB or CC. No special name, no degenerate case — just an expression that depends on all three sets.
ABC
A ∩ (B ∪ C) on three sets, frozen

Three regions of eight, and all three sets matter. The ordinary case: a column mixing ones and zeros.

This is the ordinary state, and the one the tool spends most of its time in. The result column mixes ones and zeros, which makes the expression contingent: whether it holds at a given point depends on where that point is.

Read one row and the correspondence stops being abstract. A row fixes inside or outside for each of AA, BB and CC, which picks out one region; the Result cell says whether the expression holds there; and that is why the region is shaded or blank. Eight rows, eight regions, no gaps.

Three sets is also where identities become worth checking. Type (AB)(AC)(A \cap B) \cup (A \cap C) next and the column is identical — the distributive law, verified over all eight rows rather than argued for. The method is in checking an identity.

Linking a Row to a Region

Click any row of the table and the region it describes is outlined on the diagram. Click any region and the row that describes it is selected. Clicking the same one again clears the selection.

This is the feature that makes the correspondence concrete rather than asserted. A row that reads true, false for sets AA and BB picks out the part of AA lying outside BB — one specific area of the picture, not a general idea about it.

The explanation panel changes while a row is selected: it spells out which memberships the row fixes and whether the expression is true there, which is the reason that region is shaded or blank.

The deeper point is that every point of the universe lies in exactly one region, so every point is described by exactly one row. That is why the table has no gaps and no overlaps, and why a finite table can settle a claim about arbitrarily large sets. Frozen mid-selection, one row and one region show the pairing directly.

One Row, One Region

With ABA \cap B in the box, clicking the row for AA alone outlines that region on the diagram: inside AA, outside BB. The expression is false there, which is why the region sits blank inside the dashed outline.
AB
A ∩ B with the A-only row picked, frozen

The dashed outline is the region that row describes. It is blank because the expression is false there.

Selection is the feature that turns the correspondence from a claim into something you can point at. The row fixes a membership pattern; the outline shows which part of the picture that pattern describes. Clicking the region instead of the row does the same thing from the other side, and clicking again clears it.

A selected row can be true or false, and both are worth seeing. A true row outlines a shaded region and explains why it is shaded; a false row, like this one, outlines a blank region and explains why it is blank.

Underneath this is the fact that makes the whole tool work: every point of the universe lies in exactly one region, so every point is described by exactly one row. The table is a partition of all the possibilities, which is why checking every row is a complete argument and not a sample.

Writing Expressions the Parser Accepts

The parser is the same one the Venn diagram generator uses, so the notation carries over.

Operators need something on both sides, and the complement mark goes after what it negates: AcA^c, not a prefix. Brackets group exactly as they do in arithmetic, and nesting is allowed, so ((AB)C)c((A \cap B) \setminus C)^c is a single valid expression.

Only the set letters currently drawn are accepted. Asking for CC while in two-set mode reports an unknown set rather than guessing.

Two habits help. Build long expressions in stages — type an inner part, check the shading, then wrap it — and read the error text rather than retyping blindly, because it names the token the reader stopped at.

The As logic line is also a check on your intent: if the logical rewrite is not what you meant, the set expression is not either.

Two failures are worth meeting deliberately rather than by accident: an expression that will not parse, and a set that is not on the diagram.

A few input conveniences carry over from the generator as well. The complement can be written with a prime mark or a star instead of the superscript, and the difference sign may be typed as a plain hyphen. Whatever spelling you use, the diagram and the table update on the same keystroke, so there is never a moment where the two views disagree.

An Expression That Will Not Parse

Type A(BA \cap (B and the box turns red. The reader reached the end of the expression still waiting for a closing bracket, so it stops and says so rather than guessing what you meant.
A ∩ (BExpected a closing bracketBoth views hold their previous shading until the expression parses.
A ∪ (B — frozen

The reader ran out of expression while still waiting for a closing bracket, so it reports rather than guesses.

Both views hold their previous shading while an expression is unparseable. Nothing is cleared, because there is no new answer to show — only a message about the reading.

Three causes account for nearly all of these. An unclosed bracket, as here. An operator with nothing on one side, such as a trailing intersection sign. And a complement mark placed before what it negates instead of after it.

The error names the token the reader stopped at, which is usually more useful than retyping the whole expression. Build long expressions in stages and the parse failures stay local: type an inner part, watch it shade, then wrap it.

The other way an expression can fail is to be perfectly well formed and mention a set that is not on the diagram.

A Set That Is Not on the Diagram

Type ACA \cap C in two-set mode and nothing is wrong with the syntax — the expression simply names a set that is not drawn. The tool reports the unknown letter and lists what is available.
A ∩ CUnknown set “C” — the diagram holds A, BBoth views hold their previous shading until the expression parses.
A ∩ C in two-set mode, frozen

Well formed, but it names a set that is not drawn. The tool refuses to treat the unknown set as empty.

This is a different failure from a parse error. The expression is well formed; it just refers to something that does not exist here. In logical terms it uses a free variable the model has no interpretation for.

The fix is either to switch to three sets, which brings CC into existence, or to rewrite using only the letters on the diagram. Switching is usually what you want, and it rebuilds both views at 8 regions and 8 rows.

Notice what the tool does not do: it does not silently treat the unknown set as empty. That would produce a shading, and a shading is an answer — it would look like a result rather than a mistake. Refusing to guess is what keeps the two views trustworthy.

Checking an Identity

The tool has no compare box, and does not need one: the result column is a fingerprint.

Type one side of an identity, note the signature in the Regions heading, then type the other side and compare. Matching columns mean the two expressions shade the same regions, which for sets means they are equal.

Worth doing at least once each:

• De Morgan: (AB)c(A \cup B)^c against AcBcA^c \cap B^c — the columns agree.
• The false pairing: (AB)c(A \cap B)^c against AcBcA^c \cap B^c — they do not.
• Distribution: A(BC)A \cap (B \cup C) against (AB)(AC)(A \cap B) \cup (A \cap C), in three-set mode.
• Difference as intersection: ABA \setminus B against ABcA \cap B^c.

Because the check runs over all 2n2^n rows, agreement is a proof for those sets rather than a suggestive picture. A single differing row is a counterexample, and the row tells you exactly which membership pattern breaks the claim.

Set Notation and Logic Notation

Set theory and propositional logic look nothing alike on the page and are the same algebra underneath. The key below the table is the dictionary:

• Intersection \cap is conjunction \wedge — in both sets.
• Union \cup is disjunction \vee — in either.
• Complement c^c is negation ¬\neg — not in.
• Symmetric difference \oplus is exclusive or — in exactly one.
• The universe UU is truth, and the empty set \varnothing is falsity.

Difference has no single logical symbol because it is already a compound: ABA \setminus B is A¬BA \wedge \neg B, which is how the As logic line rewrites it.

The translation is mechanical, and it runs in both directions. Every set identity you prove is a logical equivalence you have proved at the same time, because the two notations describe one structure — a Boolean algebra. That is why the diagram and the table can never disagree.

What a Truth Table Is

A truth table lists every possible assignment of true and false to the variables of an expression, and records the value of the expression under each.

With nn variables there are 2n2^n assignments, because each variable is independently true or false. Two variables give 4 rows, three give 8, and the count doubles with every variable added.

The table is a decision procedure rather than an argument. To ask whether two expressions are equivalent, you do not need to reason about them — you build both columns and compare, and the answer is certain because the rows exhaust the possibilities.

Here the variables are memberships: the proposition is that the point lies in AA, and the region is that assignment made visible. Nothing about the method changes; only the reading of what the variables stand for.

That reframing is what lets a table settle a question about sets. A claim about two sets is a claim about every point, and every point falls under exactly one of the four assignments, so four rows exhaust the argument. For the propositional-logic treatment, see truth tables.

Tautologies and Contradictions

Two result columns are special because they do not depend on the sets at all.

A column of all ones is a tautology: the expression is true under every assignment, so every region is shaded and the expression equals the universe. AAcA \cup A^c is the standard case — a point is either in AA or outside it, and there is no third option. That is the law of the excluded middle wearing set notation.

A column of all zeros is a contradiction: false under every assignment, nothing shaded, and the expression equals the empty set. AAcA \cap A^c is the standard case, since no point is both in and out.

The two are complements of each other, in both alphabets at once: negate a tautology and you get a contradiction, complement the universe and you get the empty set. Each has its own frame below: every region shaded and no region shaded. Everything else — every expression whose column mixes ones and zeros — is contingent, and its truth depends on which sets you actually have.

Every Region Shaded

AAcA \cup A^c shades all four regions, and the result column reads all ones. Nothing is left blank, whatever the sets contain.
AB
A ∪ Aᶜ, frozen

All four regions shaded. Every point is in A or outside it, so the shading cannot be broken by any choice of A.

In set terms this expression equals the universe UU. Every point is either in AA or outside it, so every point qualifies, and no choice of AA can change that.

In logical terms it is a tautology: true under every assignment. The example is the law of the excluded middle written with circles instead of letters, and the diagram is the proof — there is nowhere left to stand.

What makes this state useful is that it is unfalsifiable by experiment. You can redraw the circles any way you like, make AA enormous or empty, and the shading does not change. An expression whose truth survives every configuration is saying something about the logic rather than about the sets.

Its exact mirror is no region shaded, and complementing either one produces the other.

No Region Shaded

AAcA \cap A^c shades nothing at all, and the result column reads all zeros. The diagram is drawn, the regions are there, and not one of them qualifies.
AB
A ∩ Aᶜ, frozen

Nothing shaded, and nothing wrong. No point is both inside A and outside it, so the intersection collects nothing.

In set terms the expression equals the empty set \varnothing, for any AA whatsoever. No point is both inside AA and outside it, so the intersection has nothing to collect.

In logical terms it is a contradiction: false under every assignment. It is the negation of the tautology in the previous frame, and the pairing runs through both notations at once — the universe and the empty set correspond exactly to the tautology and the contradiction.

An empty shading is easy to mistake for a broken expression, which is why the tool distinguishes the two. Nothing shaded because the expression is a contradiction is a result; nothing shaded because the expression would not parse is a message. The result column tells you which you are looking at.

The Named Connectives

With two sets there are 4 regions, so a result column is 4 bits, so there are 24=162^4 = 16 distinct expressions up to equivalence. That is exactly the number of binary logical connectives, and it is not a coincidence — it is the same count arrived at twice.

Several of the sixteen have names, and the tool announces them when your expression lands on one:

ABA \cap B is conjunction, AND.
ABA \cup B is disjunction, OR.
ABA \oplus B is exclusive or, XOR.
(AB)c(A \cap B)^c is the Sheffer stroke, NAND.
(AB)c(A \cup B)^c is the Peirce arrow, NOR.
AcBA^c \cup B is material implication, if AA then BB.
(AB)c(A \oplus B)^c is the biconditional, if and only if.

Implication is the one worth dwelling on. Written as sets it says every point of AA lies in BB, which is containment; written as logic it is the conditional. It is the case frozen at when the column has a name. For the logical treatment, see implications.

When the Column Has a Name

AcBA^c \cup B shades three of the four regions — everything except the part of AA outside BB — and the tool names the column: this is material implication, if AA then BB.
AB
Aᶜ ∪ B, frozen

Three regions of four. The one blank region is the only way the implication can fail: something in A that is not in B.

The naming is not decoration. With two sets a result column is 4 bits, so there are 24=162^4 = 16 possible columns, and that is exactly the number of binary logical connectives. Several of the sixteen are famous enough to have names, and landing on one is worth knowing about.

Implication is the most instructive. As sets, AcBA^c \cup B says every point of AA lies in BB — which is containment, ABA \subseteq B, whenever the shading is complete. As logic it is the conditional. The single blank region is the only way the implication can fail: something in AA that is not in BB.

That also explains the notorious truth-table row where a false antecedent makes the conditional true. On the diagram it is simply a region outside AA — nothing there is being claimed, so nothing there can break the claim.

Other named columns in the same catalog include the Sheffer stroke, the Peirce arrow, and the biconditional.

When an Expression Ignores a Set

Sometimes flipping membership in one set changes nothing: every row keeps its value, and the shading is symmetric across that circle. The tool detects this and says which set is being ignored.

The classic case is A(AB)A \cap (A \cup B). It mentions BB, but BB never affects the outcome — the expression simplifies to AA, by the absorption law. The column is the column of AA.

A column that survives deleting a variable is the signal that the expression can be simplified, and it is how redundancy is detected mechanically rather than by inspection. In circuit design the same test identifies an input that can be removed.

Notice that mentioning a set and depending on it are different things. The parser sees the letter; the table sees whether it matters.

The frozen case is a column that ignores a set.

The diagram shows the same fact geometrically. If an expression ignores BB, its shading is symmetric across the boundary of circle BB — whatever is shaded inside is shaded outside, so the curve cuts through the shaded area without changing it. A boundary that makes no difference to the picture is a variable that makes no difference to the answer. For the algebraic laws behind the simplification, see set laws and identities.

A Column That Ignores a Set

A(AB)A \cap (A \cup B) shades exactly circle AA. The expression mentions BB, but the shading is symmetric across BB's boundary — the curve passes straight through the shaded area without changing it.
AB
A ∩ (A ∪ B), frozen

The shading is exactly circle A. B’s boundary runs through it without changing anything, which is what absorption looks like.

The expression simplifies to AA by the absorption law, so BB is along for the ride. Flip membership in BB and every row keeps its value; the BB column could be deleted from the table without affecting the Result column at all.

That is the general test, and it is mechanical rather than a matter of inspection: a variable that never changes the answer is a variable the expression does not depend on, however often it appears in the text. The tool checks each set this way and reports the ones that make no difference.

A column that survives deleting a variable is the signal that the expression can be simplified. In circuit design the same test finds an input that can be cut; in proof work it finds a hypothesis that was never used.

Compare an expression that genuinely uses everything it mentions, such as an ordinary mixed column.