Cartesian Product Generator

Combine two to four lists into every possible combination — one item from each list. Paste spreadsheet cells directly, join with spaces, dashes, or a custom separator, add a prefix or suffix, and output plain lines, CSV rows, JSON, or just the count. Runs entirely in your browser.

Try:
Combinations

Every Combination, One Item From Each List

The cartesian product takes one item from every list and produces all possible tuples: 2 colors × 3 sizes = 6 combinations, add 2 materials and you get 12. Paste up to four lists (items separated by tabs, newlines, commas, semicolons, or pipes — auto-detected, so spreadsheet cells paste straight in), and the generator writes out every combination instantly. Everything runs locally in your browser; your data never leaves your device.

Worked example

List 1 red, blue × List 2 S, M, L, joined with a space:

red S
red M
red L
blue S
blue M
blue L

The count is always the product of the list sizes (here 2 × 3 = 6), and the rightmost list cycles fastest — the same order Python's itertools.product or a SQL CROSS JOIN gives you.

Features

Limits and edge cases

FAQ

What order are the combinations generated in?

Odometer order: the first list varies slowest and the last list varies fastest, exactly like nested loops, Python's itertools.product, or a SQL CROSS JOIN. red, blue × S, M gives red S, red M, blue S, blue M. The input order of items within each list is preserved.

Can I paste straight from a spreadsheet?

Yes. A pasted column arrives newline-separated and a pasted row arrives tab-separated — auto-detection handles both, and tab mode also splits on line breaks, so even a rectangular block of cells becomes one item per cell. Numbers keep their exact formatting (007 stays 007).

How do I know how many combinations I'll get before generating?

Set Output format to Count only. It reports the multiplication — for example 2 x 3 x 2 = 12 — without generating anything, and it is exempt from the Max combinations cap, so you can safely size up products in the millions before deciding how to split the work.

How do I combine more than four lists?

Chain runs: generate the product of the first lists, then paste the result into List 1 of a second run (each output line becomes one item, since lines are split on newlines) and put the fifth list in List 2. Repeat as needed — the cap still applies to each run.

Why do I get an error instead of a truncated result for huge products?

Combination counts explode fast — four lists of 20 items are already 160,000 tuples. A silently truncated list looks complete but isn't, which is dangerous for variant matrices or test grids, so the tool refuses and tells you the exact count instead. Raise Max combinations (up to 100,000) or shrink a list.

Is this the same as combinations or permutations?

No. The cartesian product picks one item from each list (lists stay separate: color × size). Combinations and permutations pick several items from the same list, with order ignored or respected. If you want pairs drawn from a single list, this is not the tool for that.

Where is my list data sent?

Nowhere. Splitting, combining, and formatting run entirely in your browser via WebAssembly — there is no server call, upload, or tracking of your list contents.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool cartesian-product "red, blue, green" 'list2=S, M, L'

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/cartesian-product/?list1=red%2C%20blue%2C%20green&list2=S%2C%20M%2C%20L&list3=cotton%2C%20linen&list4=slim%2C%20regular&item_separator=auto&dedupe=true&output_format=lines&join_separator=space&custom_join_separator=%20%3A%3A%20&prefix=sku-&suffix=-2026&max_combinations=10000