Advanced Cartesian Product Calculator

Build ordered pair sets from your inputs quickly. View counts, matrices, exports, and explanations for dependable relation analysis today.

Calculator Input

Separate values using commas, semicolons, pipes, or new lines.
Blank items are ignored during set construction.
Reset

Example Data Table

Example Set A Example Set B Product Size Sample Ordered Pairs
{1, 2, 3} {x, y} 6 (1, x), (1, y), (2, x), (2, y)
{red, blue} {circle, square, star} 6 (red, circle), (red, square), (blue, circle)
{0, 1} {true, false} 4 (0, true), (0, false), (1, true), (1, false)

Formula Used

A × B = { (a, b) | a ∈ A and b ∈ B }

For any two sets, the cartesian product contains every possible ordered pair where the first element comes from the first set and the second element comes from the second set.

|A × B| = |A| × |B|

The number of ordered pairs equals the product of the number of unique elements in each set. If set A has 3 elements and set B has 4 elements, the cartesian product has 12 ordered pairs.

How to Use This Calculator

  1. Enter the elements of the first set in the Set A box.
  2. Enter the elements of the second set in the Set B box.
  3. Choose labels, sorting mode, pair style, and optional display settings.
  4. Decide whether duplicates should be removed before calculation.
  5. Click the calculation button to generate the ordered pairs.
  6. Review the result summary, full pair table, and optional matrix.
  7. Use the CSV or PDF buttons to export the generated result.

Frequently Asked Questions

1. What is a cartesian product?

A cartesian product is the set of all ordered pairs formed from two sets. The first item comes from the first set, and the second item comes from the second set.

2. Why does order matter in each pair?

Order matters because (a, b) is generally different from (b, a). Cartesian products preserve the source position of each element, which is important in relations and mappings.

3. How is the number of pairs calculated?

Multiply the number of elements in the first set by the number in the second set. Three elements times four elements produces twelve ordered pairs.

4. Can the calculator remove duplicates?

Yes. The duplicate removal option treats repeated inputs as a single set element. This helps align the result with standard set theory definitions.

5. What happens if one set is empty?

If either set is empty, the cartesian product is empty. This calculator asks for valid entries in both sets before producing a result.

6. Can I use words, numbers, or symbols?

Yes. You can enter numbers, names, labels, symbols, or mixed values. The calculator treats each cleaned entry as a separate element.

7. What is the membership matrix showing?

The matrix shows which combinations exist between the two sets. For a full cartesian product, every possible combination exists, so each matrix cell is marked present.

8. When is a cartesian product useful?

It is useful in set theory, databases, coordinate geometry, relations, mappings, testing combinations, and any problem that needs every possible pairing.

Related Calculators

hasse diagram generatorset intersection calculatorordered pair generatorset relation calculatorset union calculatorset algebra calculatorset notation converterset complement calculatorset equation solverset equality checker

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.