How to use the set theory calculator
- Type the elements of Set A and Set B, separated by commas.
- For three-set problems, fill in Set C (optional).
- For complements, enter the Universal set U (optional, for complements). Clear it if you do not need complements.
- Read the results: A ∪ B, A ∩ B, A − B, B − A, A Δ B, the sizes, and the Relationship line.
- Use the Venn diagram regions table to fill in a diagram, region by region.
What it does and when to use it
Set operations are a standard topic in school maths, probability and discrete maths. Exam questions often ask you to shade or fill in a Venn diagram, find a complement, or check a law such as De Morgan’s. This tool does the bookkeeping, so you can concentrate on the reasoning, and it lets you test a law with your own example sets.
The same logic appears with true and false values in the truth table generator. For counting arrangements and selections from a set, use the permutation and combination calculator. The prime factorization tool lists divisors, which make good example sets.
How it works
Each set is split into elements, trimmed and de-duplicated. Then:
- A ∪ B: every element in A or B.
- A ∩ B: elements in both.
- A − B: elements of A that are not in B.
- A Δ B: (A − B) ∪ (B − A).
- A′: U − A.
- Subset: A ⊂ B when every element of A is in B and the sets are not equal.
Results are sorted numerically when every element is a number, and alphabetically otherwise. Empty results are shown as ∅.
Step by step for A = {1, 2, 3, 4, 5}, B = {4, 5, 6, 7}, U = {1, …, 10}:
- Shared elements: 4 and 5, so A ∩ B = {4, 5}.
- Join and remove repeats: A ∪ B = {1, 2, 3, 4, 5, 6, 7}.
- Check the count: |A ∪ B| = |A| + |B| − |A ∩ B| = 5 + 4 − 2 = 7.
- Everything in U outside the union: (A ∪ B)′ = {8, 9, 10}.
- De Morgan’s law says this equals A′ ∩ B′ = {6, 7, 8, 9, 10} ∩ {1, 2, 3, 8, 9, 10} = {8, 9, 10}. It does.
Worked examples
Two overlapping sets. With the sets above, the tool gives A − B = {1, 2, 3}, B − A = {6, 7} and (A ∪ B)′ = A′ ∩ B′: {8, 9, 10}.
Words, no overlap. A = {apple, pear}, B = {kiwi}: the intersection is ∅ (empty set) and the tool reports Relationship: A and B are disjoint.
Three sets. A = {1, 2, 3}, B = {2, 3, 4}, C = {3, 4, 5}: A ∩ B ∩ C: {3}. The Venn table puts 1 in “Only A”, 2 in “A ∩ B only”, 4 in “B ∩ C only” and 5 in “Only C”.
Subset. A = {2, 4}, B = {1, 2, 3, 4} gives A ⊂ B (A is a proper subset of B) and A − B = ∅.
Limits and tips
- Spaces inside an element are kept, so “New York” is one element.
- The tool works with finite lists only; it cannot handle rules such as “all even numbers”.
- Your sets stay in your browser.
Frequently asked questions
How should I type a set?
Can the elements be words?
Why do I need a universal set?
What is the symmetric difference?
Does it list the power set or the Cartesian product?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.