{
  "schemaVersion": 1,
  "slug": "baby-growth-calculator",
  "category": "health",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "ebca414a81bc134d94fbf1615d33da32f0684007198cc24fe61c342d4588c02a",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/baby-growth-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": "M(a) = T⌊a⌋ + (T⌊a⌋₊₁ − T⌊a⌋) × frac(a)",
    "vars": [
      [
        "Tᵢ",
        "WHO 50th-percentile reference at whole month i"
      ],
      [
        "a",
        "Age in months, limited to 0–24"
      ],
      [
        "frac(a)",
        "Fractional part of age in months"
      ],
      [
        "M(a)",
        "Interpolated median reference value"
      ]
    ],
    "note": "Tᵢ is the WHO 50th-percentile reference value for the selected sex at whole-month age i. Values between months are linearly interpolated. This page shows a reference median; it does not calculate a child’s percentile, z-score, weight-for-length, prematurity correction, or growth trend."
  },
  "externalEvidence": {
    "reviewedAt": "2026-09-25",
    "sources": [
      {
        "name": "CDC — WHO Growth Charts and Data Files",
        "url": "https://www.cdc.gov/growthcharts/who-data-files.htm"
      },
      {
        "name": "CDC — Growth Charts: What to Know",
        "url": "https://www.cdc.gov/growthcharts/information-for-healthcare-professionals.htm"
      }
    ]
  },
  "contract": {
    "compute": "const boysW = [3.3,4.5,5.6,6.4,7.0,7.5,7.9,8.3,8.6,8.9,9.2,9.4,9.6,9.9,10.1,10.3,10.5,10.7,10.9,11.1,11.3,11.5,11.8,12.0,12.2];\nconst girlsW = [3.2,4.2,5.1,5.8,6.4,6.9,7.3,7.6,7.9,8.2,8.5,8.7,8.9,9.2,9.4,9.6,9.8,10.0,10.2,10.4,10.6,10.9,11.1,11.3,11.5];\nconst boysL = [49.9,54.7,58.4,61.4,63.9,65.9,67.6,69.2,70.6,72.0,73.3,74.5,75.7,76.9,78.0,79.1,80.2,81.2,82.3,83.2,84.2,85.1,86.0,86.9,87.8];\nconst girlsL = [49.1,53.7,57.1,59.8,62.1,64.0,65.7,67.3,68.7,70.1,71.5,72.8,74.0,75.2,76.4,77.5,78.6,79.7,80.7,81.7,82.7,83.7,84.6,85.5,86.4];\nconst age = Math.max(0, Math.min(24, Number(ageMonths)));\nconst i0 = Math.floor(age), i1 = Math.min(24, i0 + 1), f = age - i0;\nconst at = (values) => values[i0] + (values[i1] - values[i0]) * f;\nconst weightMedian = at(sex === 'female' ? girlsW : boysW);\nconst lengthMedian = at(sex === 'female' ? girlsL : boysL);\nreturn { medianWeightKg: weightMedian, medianLengthCm: lengthMedian, weightVsMedianKg: currentWeightKg - weightMedian, lengthVsMedianCm: currentLengthCm - lengthMedian };",
    "inputs": [
      {
        "name": "ageMonths",
        "type": "number",
        "default": 6,
        "min": 0,
        "max": 24,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "sex",
        "type": "select",
        "default": "male",
        "options": [
          {
            "value": "male"
          },
          {
            "value": "female"
          }
        ]
      },
      {
        "name": "currentWeightKg",
        "type": "number",
        "default": 8.2,
        "min": 0.4,
        "max": 25,
        "step": 0.05,
        "slider": true
      },
      {
        "name": "currentLengthCm",
        "type": "number",
        "default": 68,
        "min": 30,
        "max": 120,
        "step": 0.5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "medianWeightKg",
        "precision": 2,
        "unit": "kg"
      },
      {
        "name": "medianLengthCm",
        "precision": 1,
        "unit": "cm"
      },
      {
        "name": "weightVsMedianKg",
        "precision": 2,
        "unit": "kg"
      },
      {
        "name": "lengthVsMedianCm",
        "precision": 1,
        "unit": "cm"
      }
    ],
    "interpret": null
  }
}
