Set Operations Calculator

Union, intersection & more

CalculatorsFreeNo Signup
4.2(771 reviews)
All Tools

Loading tool...

About Set Operations Calculator

A set operations calculator that performs union (A∪B), intersection (A∩B), difference (A−B), symmetric difference (A△B), and complement operations. Shows Venn diagram logic, set cardinality, subsets, and power set. Handles numeric and text elements. All processing is client-side. Essential for discrete math, database query logic, and probability.

Set Operations Calculator Features

  • Union/intersection
  • Difference
  • Symmetric diff
  • Cardinality
  • Subset check
Set operations combine or compare collections: Union (A∪B) = all elements in either set. Intersection (A∩B) = elements in both. Difference (A−B) = in A but not B. Symmetric difference (A△B) = in one but not both. These operations are fundamental to databases (SQL JOINs), probability, and logic.

How to Use

Enter two sets:

  • Set A: Comma-separated values
  • Set B: Comma-separated values
  • Operations: All computed automatically

Operations

  • A∪B: elements in A OR B (or both)
  • A∩B: elements in A AND B
  • A−B: elements in A but NOT B
  • A△B: elements in exactly one set

Properties

  • |A∪B| = |A| + |B| − |A∩B|
  • A∪B = B∪A (commutative)
  • A∩B = B∩A (commutative)
  • A−B ≠ B−A (not commutative)

Step-by-Step Instructions

  1. 1Enter Set A elements.
  2. 2Enter Set B elements.
  3. 3View all operations.
  4. 4Check cardinalities.
  5. 5Test subset relationships.

Set Operations Calculator — Frequently Asked Questions

What's the difference between difference and symmetric difference?+

A−B = elements only in A. A△B = elements in A or B but not both. Example: A={1,2,3}, B={2,3,4}. A−B={1}, A△B={1,4}.

How are sets used in databases?+

SQL UNION = set union, INTERSECT = intersection, EXCEPT = difference. JOIN operations also relate to set theory concepts.

What is the inclusion-exclusion principle?+

|A∪B| = |A| + |B| − |A∩B|. For 3 sets: |A∪B∪C| = |A|+|B|+|C| − |A∩B|−|A∩C|−|B∩C| + |A∩B∩C|.

Share this tool: