Search for a tool
Cartesian Product

Tool to generate Cartesian products of lists/sets by combining the elements to generate the complete list of possible choices.

Results

Cartesian Product -

Tag(s) : Combinatorics

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Cartesian Product' tool for free! Thank you!

Cartesian Product

Cartesian Product Generator

NB: Generation limited to 10000 items

Loading...
(if this message do not disappear, try to refresh this page)

Answers to Questions (FAQ)

What is a cartesian product? (Definition)

A Cartesian product is a combination of elements from several sets. The product is written with the symbol ×. It is the totality of the possible combinations among the sets of elements.

How to generate the list of combinations of a cartesian product?

Enter the sets (1 per line) in the generator table and click on generate.

Example: Generation of all playing card figures (jack, queen, king) of each color (spade, heart, diamond, club)
The first set consists of the 3 figures {J,Q,K}, the second set of the 4 colors {,,,}.
The Cartesian product is:

J
J
J
J
Q
Q
Q
Q
K
K
K
K

How to calculate the cardinality of the cartesian product?

The cardinality (total number of combinations) is equal to the multiplication of the cardinality of each set.

Example: A garment with 3 color choices and 5 sizes will have $ 3 \times 5 = 15 $ different possibilities

Example: A padlock with 4 wheels that can define a 4-letter code (26 possible letters for each wheel) will have a cardinality of $ 26 \times 26 \times 26 \times 26 = 456976 $ possible words.

Source code

dCode retains ownership of the "Cartesian Product" source code. Any algorithm for the "Cartesian Product" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Cartesian Product" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Cartesian Product" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.

Cite dCode

The content of the page "Cartesian Product" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source. Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link: https://www.dcode.fr/cartesian-product
In a scientific article or book, the recommended bibliographic citation is: Cartesian Product on dCode.fr [online website], retrieved on 2025-04-16, https://www.dcode.fr/cartesian-product

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Cartesian Product' tool for free! Thank you!


https://www.dcode.fr/cartesian-product
© 2025 dCode — The ultimate collection of tools for games, math, and puzzles.
 
Feedback