{
  "slug": "cartesian-product",
  "name": "gizza-ai/cartesian-product",
  "version": "0.1.0",
  "title": "Cartesian Product Generator — Every Combination of 2–4 Lists — gizza.ai",
  "description": "Generate every combination across 2-4 lists (sizes x colors x materials) — or just count them. Paste spreadsheet cells, pick any separator, output lines, CSV, JSON.",
  "tags": [
    "cartesian product",
    "combination generator",
    "combine lists",
    "all combinations",
    "product variants generator",
    "seo keyword combiner",
    "cross join lists",
    "tuple generator",
    "word combiner",
    "keyword mixer",
    "merge word lists",
    "combination counter"
  ],
  "category": "math",
  "urls": {
    "page": "https://gizza.ai/tools/cartesian-product/",
    "markdown": "https://gizza.ai/tools/cartesian-product/index.md",
    "descriptor": "https://gizza.ai/tools/cartesian-product/tool.json",
    "deep_link_example": "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"
  },
  "cli": "gizza tool cartesian-product \"red, blue, green\" 'list2=S, M, L'",
  "tool": {
    "description": "Generate the cartesian product of two to four lists — every combination that takes one item from each list (e.g. sizes x colors x materials). Items inside each list are split by tab/newline/comma/semicolon/pipe (auto-detected via item_separator; slash on request), trimmed, blanks dropped, optionally deduped. Output one combination per line joined by join_separator (space/none/comma/dash/underscore/pipe/tab/newline/custom) with optional prefix/suffix, as CSV rows, a JSON array of arrays, or just the count ('2 x 3 = 6', exempt from the cap). The rightmost list varies fastest. max_combinations (default 10000, cap 100000) guards against exploding output.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "custom_join_separator": {
          "default": "",
          "description": "Join string used when join_separator is 'custom', e.g. ' :: '.",
          "type": "string"
        },
        "dedupe": {
          "default": false,
          "description": "Remove duplicate items within each list before combining (keeps first occurrence).",
          "type": "boolean"
        },
        "item_separator": {
          "default": "auto",
          "description": "How items inside each list are split. 'auto' (default) tries tab, then newline, comma, semicolon, pipe. 'tab' also splits on line breaks (paste spreadsheet cells directly). 'slash' is never auto-detected (URLs/dates keep their slashes). Items are trimmed and blanks dropped.",
          "enum": [
            "auto",
            "comma",
            "newline",
            "semicolon",
            "pipe",
            "tab",
            "slash"
          ],
          "type": "string"
        },
        "join_separator": {
          "default": "space",
          "description": "What joins the items of each combination in 'lines' output: space ' ', none '', comma ', ', dash '-', underscore '_', pipe '|', tab, newline, or 'custom' (see custom_join_separator). Ignored for csv/json/count.",
          "enum": [
            "space",
            "none",
            "comma",
            "dash",
            "underscore",
            "pipe",
            "tab",
            "newline",
            "custom"
          ],
          "type": "string"
        },
        "list1": {
          "description": "First list. Items separated by newline, comma, semicolon or pipe (auto-detected unless item_separator says otherwise), e.g. 'red, blue, green'.",
          "type": "string"
        },
        "list2": {
          "description": "Second list, same format as list1, e.g. 'S, M, L'.",
          "type": "string"
        },
        "list3": {
          "default": "",
          "description": "Optional third list, e.g. 'cotton, linen'. Leave empty to combine only two lists.",
          "type": "string"
        },
        "list4": {
          "default": "",
          "description": "Optional fourth list. Leave empty if unused.",
          "type": "string"
        },
        "max_combinations": {
          "default": 10000,
          "description": "Safety cap on the number of generated combinations (list sizes multiplied). Exceeding it is an error that reports the exact count. Default 10000, hard cap 100000.",
          "maximum": 100000,
          "minimum": 1,
          "type": "integer"
        },
        "output_format": {
          "default": "lines",
          "description": "'lines' (default): one combination per line, items joined by join_separator. 'csv': one quoted CSV row per combination. 'json': JSON array of per-combination arrays. 'count': only the combination count, e.g. '2 x 3 = 6' — never generates, so it is exempt from max_combinations.",
          "enum": [
            "lines",
            "csv",
            "json",
            "count"
          ],
          "type": "string"
        },
        "prefix": {
          "default": "",
          "description": "Text prepended to every combination line ('lines' output only), e.g. 'sku-'.",
          "type": "string"
        },
        "suffix": {
          "default": "",
          "description": "Text appended to every combination line ('lines' output only), e.g. '-2026'.",
          "type": "string"
        }
      },
      "required": [
        "list1",
        "list2"
      ],
      "type": "object"
    }
  }
}