{
  "schemaVersion": 1,
  "slug": "ingredient-substitution-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "7ad9f3f78e7ecd9c25b4090b288d236dc22414c6548191aba3b6e9024c9a7d04",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/ingredient-substitution-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": "(s′, r, n′) = T[x]",
    "vars": [
      [
        "x",
        "selected ingredient"
      ],
      [
        "T",
        "substitution lookup table (10 ingredients)"
      ],
      [
        "s′",
        "mapped substitute"
      ],
      [
        "r",
        "replacement proportion"
      ],
      [
        "n′",
        "usage notes"
      ]
    ],
    "note": "Pure lookup over 10 ingredients (e.g. baking powder → 1/4 tsp baking soda + 1/2 tsp cream of tartar per tsp); an unknown key defaults to the buttermilk row."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "University of Nebraska–Lincoln — Recipe ingredient substitutions",
        "url": "https://food.unl.edu/article/ingredient-substitutions"
      }
    ],
    "referenceRole": "context",
    "implementationHash": "7ad9f3f78e7ecd9c25b4090b288d236dc22414c6548191aba3b6e9024c9a7d04",
    "basis": "(s′, r, n′) = T[x]",
    "limitations": "The references provide context and limitations. They do not validate this page’s illustrative multipliers, lookup values or predictions."
  },
  "contract": {
    "compute": "const S = { buttermilk:['Milk + lemon juice or vinegar','1 tbsp acid per cup of milk','Let stand 5 minutes before using'], bakingpowder:['Baking soda + cream of tartar','1/4 tsp soda + 1/2 tsp cream of tartar per tsp','Use immediately, it activates on contact'], brownsugar:['Granulated sugar + molasses','1 tbsp molasses per cup of sugar','Adds the same moisture and acidity'], cornsyrup:['Honey or golden syrup','Equal amount','Honey is sweeter and browns faster'], heavycream:['Butter + milk','1/4 cup butter + 3/4 cup whole milk per cup','Will not whip, use for cooking only'], selfrising:['Plain flour + baking powder + salt','1.5 tsp powder + 0.5 tsp salt per cup','Skip added leavening in the recipe'], cakesflour:['Plain flour + cornstarch','2 tbsp cornstarch per cup, sifted twice','Gives the finer, softer crumb'], honey:['Granulated sugar + liquid adjustment','Use a recipe-tested substitution ratio; reduce other liquid as directed by the recipe','Honey browns faster; do not raise oven temperature based on this guide'], lemonjuice:['White vinegar or lime juice','Equal amount','Flavour differs but acidity matches'], eggyolk:['No universal direct substitute','Depends on the yolk’s role in the recipe','Yolk provides fat and emulsifiers; a swap can change structure'] }; const s = S[ingredient] || S.buttermilk; return { substitute: s[0], proportion: s[1], notes: s[2] };",
    "inputs": [
      {
        "name": "ingredient",
        "type": "select",
        "default": "buttermilk",
        "options": [
          {
            "value": "buttermilk"
          },
          {
            "value": "bakingpowder"
          },
          {
            "value": "brownsugar"
          },
          {
            "value": "cornsyrup"
          },
          {
            "value": "heavycream"
          },
          {
            "value": "selfrising"
          },
          {
            "value": "cakesflour"
          },
          {
            "value": "honey"
          },
          {
            "value": "lemonjuice"
          },
          {
            "value": "eggyolk"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "substitute",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "proportion",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "notes",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
