Skip to content
TextArray
100% local

Cartesian product of lists

Cross every item of one list with every item of the others — all combinations, one per line.

Input
Output

Cartesian product of lists

Some lists only exist when you multiply them: every colour × every size, every first name × every surname, every UTM source × medium × campaign, every product base × variant. Writing those out by hand is exactly the tedious, error-prone job a computer should do. Paste your lists here — one item per line, each list separated by a blank line — and every combination comes out, one per line, in a predictable order.

The order is an odometer: the last list varies fastest, the first slowest, so red/blue × S/M gives red S, red M, blue S, blue M. That grouping keeps related combinations together, which is what you want when the result feeds a spreadsheet column, a batch of test cases or a set of file names. Add a third and fourth list and the pattern extends — the tool handles any number of lists, limited only by the total size.

The join between items is yours: a space for readable labels, nothing for concatenated codes, a hyphen or slash for identifiers, a tab for pasting into columns. Duplicates within a list are removed by default so a repeated item does not silently multiply the output. The tally shows the exact combination count and the number of lists before you commit.

Because the count is the product of the list sizes, it explodes fast — four lists of forty items is 2.5 million rows. The tool computes that product up front and refuses anything that would freeze the tab, telling you the number so you can shorten a list. Everything runs locally in your browser — your lists never leave your device.

FAQ

How do I enter multiple lists?
One item per line, and separate each list with a blank line. Two blank-line-separated blocks are two lists; three blocks are three lists, and so on. Runs of extra blank lines collapse to one separator, and item whitespace is trimmed.
What order are the combinations in?
Odometer order: the last list cycles fastest, the first slowest. So list A of {a,b} and list B of {1,2} yields a1, a2, b1, b2. This keeps each first-list item's combinations grouped together.
What is the difference from the combination generator?
The combination generator picks groups from a single list. This crosses several distinct lists — one item from each — which is the Cartesian product. Use this when the lists are different dimensions (colour, size, material); use combinations when they are one pool.
Why did it refuse to generate?
The number of combinations is the product of the list sizes, which grows explosively — four lists of forty is 2.5 million rows. When that product would be unsafe to build, the tool stops and shows the count, so you can trim a list rather than freeze the tab.
Are my lists uploaded anywhere?
No. The combining runs entirely in your browser and your lists never leave your device.