Two sets
A × B = {(a, b) | a ∈ A and b ∈ B}
Each ordered pair chooses its first coordinate from A and its second coordinate from B.
Separate elements with commas, semicolons, or line breaks. Optional outer braces are accepted. Blank input or ∅ represents the empty set.
Private by design: your sets and generated tuples stay on this device. Inputs are not uploaded, saved, or added to the page URL.
A × B = {(a, b) | a ∈ A and b ∈ B}
Each ordered pair chooses its first coordinate from A and its second coordinate from B.
|A × B| = |A| · |B|
For every element of A, there is one pair with each element of B.
A₁ × ··· × Aₙ = {(a₁, …, aₙ) | aᵢ ∈ Aᵢ}
Each n-tuple contains exactly one coordinate from every factor set.
|A₁ × ··· × Aₙ| = ∏ᵢ₌₁ⁿ |Aᵢ|
Multiply all factor cardinalities. If any factor is empty, the product is empty.
Tuple order is significant. For example, (1, x) is not the same ordered pair as (x, 1). Consequently, A × B and B × A generally contain different ordered pairs even though their cardinalities are equal.
{1, 2} × {x, y}
= {(1, x), (1, y), (2, x), (2, y)}
There are 2 · 2 = 4 ordered pairs.
{a, b} × {1, 2} × {T, F}
This product has 2 · 2 · 2 = 8 ordered triples, from (a, 1, T) through (b, 2, F).
A × ∅ × C = ∅
No tuple can contain a coordinate chosen from ∅, so the product has zero elements regardless of A and C.
The calculator first trims every label, normalizes Unicode text, and removes duplicates within each set. It then multiplies the unique-element counts using exact integers. For generated output, it enumerates tuples in nested-loop order: the last set changes fastest, followed by the next-to-last set. Input order controls display order only; the elements of a mathematical set are unordered.
You may enter two to eight sets, with up to 1,000 unique elements and 20,000 characters per set. Individual element labels are limited to 80 characters. Tuple generation, copy, and download are available for products of up to 100,000 tuples; larger products still receive an exact cardinality without allocating an impractically large list. Commas, semicolons, and line breaks act as separators and therefore cannot be part of one element label.
Input values are treated as text labels. Thus 1 and 1.0 are distinct, as are A and a. If you need coordinates with embedded commas, use an unambiguous replacement label before calculating.
The Cartesian product A × B contains every ordered pair (a, b) whose first coordinate is in A and whose second coordinate is in B. With more factors, the results are ordered tuples.
Multiply the cardinalities of the factor sets. For example, sets with 3, 4, and 2 elements produce 3 · 4 · 2 = 24 ordered triples.
Yes. Coordinates have fixed positions, so (a, b) generally differs from (b, a). Swapping the factor sets also swaps the coordinate roles.
Not as a set of ordered tuples: A × B generally does not equal B × A. Their cardinalities are equal for finite sets because multiplication is commutative.
The complete product is ∅ and its cardinality is zero. A tuple cannot be formed unless one element can be selected from every factor set.
Yes. Add up to eight sets. The calculator returns ordered triples for three sets, ordered quadruples for four sets, and n-tuples in general.
No. A set contains unique elements, so duplicate labels are removed within each input. The field summary shows how many duplicates were removed.
Listing every tuple can become enormous. The calculator reports the exact cardinality for any valid input but generates at most 100,000 tuples to protect browser responsiveness.
No. Parsing, cardinality calculation, tuple generation, copying, and CSV creation happen locally in your browser.