Math & Science Popular

Union and Intersection Calculator 2026

Compute set union A ∪ B, intersection A ∩ B, relative differences, and symmetric difference.

Union and Intersection Calculator 2026

Instant real-time calculation

Number of elements in set A.

Number of elements in set B.

Number of elements common to both sets.

Calculation Output
Result
|A ∪ B| = 6 | |A ∩ B| = 2
Detailed Breakdown
Cardinality |A|4
Cardinality |B|4
Intersection |A ∩ B|2
Union |A ∪ B| = |A|+|B|-|A∩B|4 + 4 - 2 = 6
Difference |A \ B| = |A| - |A∩B|2
Difference |B \ A| = |B| - |A∩B|2
Symmetric Difference |A Δ B|4
Jaccard Similarity Index J(A,B)33.33%
|A ∪ B| = 6, |A ∩ B| = 2. Jaccard similarity index is 33.3%.

Comprehensive Guide to Union and Intersection Calculator 2026

Set Union, Intersection, and Difference: Complete Guide

Set operations form the mathematical language of data structures, database queries (SQL joins), and probability theory.

Fundamental Operations Explained

  1. 1Union ($A \cup B$): The set of all elements that belong to $A$, $B$, or both:
A \cup B = \{x \mid x \in A \lor x \in B\}
  1. 1Intersection ($A \cap B$): The set of elements that belong to both $A$ and $B$:
A \cap B = \{x \mid x \in A \land x \in B\}
  1. 1Relative Complement / Set Difference ($A \setminus B$): Elements in $A$ that are not in $B$:
A \setminus B = \{x \mid x \in A \land x \notin B\}
  1. 1Symmetric Difference ($A \Delta B$): Elements in either $A$ or $B$, but not in their intersection:
A \Delta B = (A \setminus B) \cup (B \setminus A) = (A \cup B) \setminus (A \cap B)

The Principle of Inclusion-Exclusion

To calculate the total size of the union without double-counting common elements:

|A \cup B| = |A| + |B| - |A \cap B|

Set Operations Matrix

OperationSymbolSQL EquivalentVenn Diagram Region
Union$A \cup B$FULL OUTER JOINBoth circles combined
Intersection$A \cap B$INNER JOINCentral overlap football
Difference$A \setminus B$LEFT JOIN ... WHERE B IS NULLCrescent moon of A
Symmetric Diff$A \Delta B$Outer union minus innerOuter crescents of both

Frequently Asked Questions About Union and Intersection Calculator 2026

If A ∩ B = ∅, the sets are called disjoint or mutually exclusive. They share zero common elements.