{
  "schemaVersion": 1,
  "slug": "baking-altitude-adjustment-calculator",
  "category": "cooking",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "e1bad8f08c0ae50c69efc75e1662473e97171dd94e980f92f62a3b86393e4f3a",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/baking-altitude-adjustment-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": "T' = T + round(max(a − 3000, 0) ÷ 1500) × 15; P' = P × max(1 − 0.1 × max(a − 3000, 0) ÷ 1500, 0.4); S' = S × max(1 − 0.05 × max(a − 3000, 0) ÷ 1500, 0.7); L' = L × (1 + 0.03 × max(a − 3000, 0) ÷ 1500)",
    "vars": [
      [
        "a",
        "Altitude, ft"
      ],
      [
        "T",
        "Original oven temp, °F"
      ],
      [
        "P",
        "Original baking powder"
      ],
      [
        "T'",
        "Adjusted temp"
      ],
      [
        "P'",
        "Adjusted baking powder"
      ]
    ],
    "note": "At or below 3,000 ft there is no adjustment. Above this, rounded temperature steps use 1,500-ft intervals; ingredient percentages scale from (altitude − 3,000 ft), with baking powder and sugar floors of 0.4 and 0.7."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "King Arthur Baking — High-altitude baking guidance",
        "url": "https://www.kingarthurbaking.com/learn/resources/high-altitude-baking"
      }
    ],
    "referenceRole": "context",
    "implementationHash": "e1bad8f08c0ae50c69efc75e1662473e97171dd94e980f92f62a3b86393e4f3a",
    "basis": "T' = T + round(max(a − 3000, 0) ÷ 1500) × 15; P' = P × max(1 − 0.1 × max(a − 3000, 0) ÷ 1500, 0.4); S' = S × max(1 − 0.05 × max(a − 3000, 0) ÷ 1500, 0.7); L' = L × (1 + 0.03 × max(a − 3000, 0) ÷ 1500)",
    "limitations": "The references provide context and limitations. They do not validate this page’s illustrative multipliers, lookup values or predictions."
  },
  "contract": {
    "compute": "const steps = Math.max((altitude-3000)/1500, 0); const roundedSteps = Math.round(steps); const temp = ovenTempF + roundedSteps*15; const bp = bakingPowderTsp*Math.max(1-steps*0.1, 0.4); const sugar = sugarCups*Math.max(1-steps*0.05, 0.7); const liquid = liquidCups*(1+steps*0.03); const level = roundedSteps === 0 ? 'None needed' : altitude < 5000 ? 'Minor' : altitude < 8000 ? 'Moderate' : 'Significant'; return { newOvenTemp: temp, newBakingPowder: bp, newSugar: sugar, newLiquid: liquid, adjustmentLevel: level };",
    "inputs": [
      {
        "name": "altitude",
        "type": "number",
        "default": 5000,
        "min": 0,
        "max": 15000,
        "step": 100,
        "slider": true
      },
      {
        "name": "ovenTempF",
        "type": "number",
        "default": 350,
        "min": 200,
        "max": 500,
        "step": 25,
        "slider": true
      },
      {
        "name": "bakingPowderTsp",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 20,
        "step": 0.25,
        "slider": true
      },
      {
        "name": "sugarCups",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 20,
        "step": 0.25,
        "slider": true
      },
      {
        "name": "liquidCups",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 20,
        "step": 0.25,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "newOvenTemp",
        "precision": 0,
        "unit": "°F"
      },
      {
        "name": "newBakingPowder",
        "precision": 2,
        "unit": "tsp"
      },
      {
        "name": "newSugar",
        "precision": 2,
        "unit": "cups"
      },
      {
        "name": "newLiquid",
        "precision": 2,
        "unit": "cups"
      },
      {
        "name": "adjustmentLevel",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
