{
  "schemaVersion": 1,
  "slug": "cold-brew-ratio-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "8744a3b3d07f9aace554dd518003e3e2776c0898905e298c55b402b59e566c1c",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/cold-brew-ratio-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "W = C × r; Q = 0.85W; D = Q × m; servings = D ÷ 250",
    "vars": [
      [
        "C",
        "coffee in grams"
      ],
      [
        "r",
        "coffee-to-water ratio"
      ],
      [
        "W",
        "brewing water in ml"
      ],
      [
        "Q",
        "concentrate yield in ml"
      ],
      [
        "d",
        "dilution multiplier"
      ],
      [
        "D",
        "final volume in ml"
      ]
    ],
    "note": "m is final volume divided by concentrate volume and must be 1–10. The 85% yield is an estimate; caffeine and drink strength are not predicted."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "Toddy — Cold-brew preparation instructions",
        "url": "https://toddycafe.com/cold-brew/instruction-manual"
      }
    ],
    "referenceRole": "context",
    "implementationHash": "8744a3b3d07f9aace554dd518003e3e2776c0898905e298c55b402b59e566c1c",
    "basis": "W = C × r; Q = 0.85W; D = Q × m; servings = D ÷ 250",
    "limitations": "The references provide context and limitations. They do not validate this page’s illustrative multipliers, lookup values or predictions."
  },
  "contract": {
    "compute": "const empty={waterMl:null,concentrateMl:null,servingsAfterDilution:null};const beans=Number(coffeeGrams),brewRatio=Number(ratio),factor=Number(dilutionRatio);if(!Number.isFinite(beans)||beans<0||!Number.isFinite(brewRatio)||![4,8,12,15].includes(brewRatio)||!Number.isFinite(factor)||factor<1||factor>10)return{...empty,__error:'inputError'};const water=beans*brewRatio,concentrate=water*0.85,finalVolume=concentrate*factor;return{waterMl:water,concentrateMl:concentrate,servingsAfterDilution:finalVolume/250};",
    "inputs": [
      {
        "name": "coffeeGrams",
        "type": "number",
        "default": 100,
        "min": 0,
        "max": 5000,
        "step": 5,
        "slider": true
      },
      {
        "name": "ratio",
        "type": "select",
        "default": 8,
        "options": [
          {
            "value": 4
          },
          {
            "value": 8
          },
          {
            "value": 12
          },
          {
            "value": 15
          }
        ]
      },
      {
        "name": "dilutionRatio",
        "type": "number",
        "default": 2,
        "step": 0.5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "waterMl",
        "precision": 0,
        "unit": "ml"
      },
      {
        "name": "concentrateMl",
        "precision": 0,
        "unit": "ml"
      },
      {
        "name": "servingsAfterDilution",
        "precision": 1,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
