Set Operations & Venn Region Calculator

Union, intersection, difference and complement, every Venn region counted — and set identities proved over all membership patterns, not just your data.

union intersect minus xor not, or the symbols | & - ^ '. An apostrophe after a set or bracket complements it.

The regions

Counting the union

Are two expressions the same?

Checking against proving

  • Two expressions agreeing on the elements you happened to type in is a coincidence, not a proof. This tries every possible pattern of membership — all 2^n of them — and only calls the result proved when they agree on all of it.
  • That distinction is the whole reason the tool exists. "These are the same for your data" and "these are the same expression" are very different claims, and most set calculators quietly make the first while sounding like the second.
  • With n sets there are exactly 2^n Venn regions, and every element falls in exactly one of them — including the region outside all of them. So the region sizes always add up to the size of the universe, which is a conservation law rather than a coincidence.
  • Inclusion-exclusion is shown term by term alongside the union counted directly, so you can watch the alternating signs land on the same number. Add the sizes, take off the pairwise overlaps, put back the triples.
  • Union binds loosest, then difference, then intersection, then complement — the same shape as or, minus, and, not. An apostrophe after a set or a bracket complements it, which is how it is usually written by hand.

How to use

  1. Type the members of each set, separated by commas or spaces.
  2. Write an expression using union, intersect, minus, xor and not.
  3. Read the result, the region breakdown, and the count of the union.

Frequently asked questions

What does the region table show?

Every part of a Venn diagram, including the part outside all the circles. Two sets make four regions, three make eight, and every element you typed falls into exactly one of them. That is why the region sizes always add up to the size of the universe — it is a conservation law, and the page shows the sum so you can watch it hold.

How can it prove two expressions are the same?

By checking every possible pattern of membership rather than the elements you happened to type. With three sets there are eight patterns — in A only, in A and B but not C, in none of them, and so on — and if two expressions agree on all eight, no collection of elements could ever tell them apart. That is a proof; agreeing on your data is a coincidence.

What order are the operations done in?

Complement binds tightest, then intersection, then difference, then union and symmetric difference last. So A union B intersect C means A union (B intersect C). If you want the other reading, use brackets — and when it matters, use them anyway, because nobody reads set precedence the same way twice.

What does the complement mean here?

Everything in the universe that is not in the set. The universe is taken to be all the elements you have typed across all the sets, so A complement is finite and printable rather than infinite. Change the sets and the complement changes with them, which is exactly how it should behave.

Why does the union count get worked out twice?

Once by inclusion and exclusion — add the sizes, subtract the pairwise overlaps, add back the triples — and once by simply counting the union. They must agree. Showing both means the arithmetic is checked in front of you rather than asserted, and the two were swept over 800 random arrangements before shipping.

Is difference the same as symmetric difference?

No, and it is the mistake most worth avoiding. A minus B is what is in A alone; A xor B is what is in exactly one of the two, so it includes what is in B alone as well. They agree whenever B sits entirely inside A, which is why checking one example proves nothing.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.