{
  "schemaVersion": 1,
  "slug": "a1c-calculator",
  "category": "health",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "977c2adc36be01393ec7bd83a0871c86a7f0ff4771c4a4a3fffaf58950e9baf0",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/a1c-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": "eAG = 28.7 × A1C − 46.7",
    "vars": [
      [
        "eAG",
        "estimated average glucose (mg/dL)"
      ],
      [
        "A1C",
        "HbA1c value (%)"
      ]
    ],
    "note": "Divide mg/dL by 18.0182 to obtain mmol/L."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-04",
    "sources": [
      {
        "name": "Nathan et al. (2008) — A1C and estimated average glucose",
        "url": "https://pubmed.ncbi.nlm.nih.gov/18540046/"
      }
    ],
    "basis": "eAG in mg/dL = 28.7 × A1C percent - 46.7; the tool converts to mmol/L by dividing by 18.0182.",
    "limitations": "Regression estimate; it does not replace measured glucose or clinical interpretation of A1C.",
    "implementationHash": "977c2adc36be01393ec7bd83a0871c86a7f0ff4771c4a4a3fffaf58950e9baf0",
    "domain": "health"
  },
  "contract": {
    "compute": "const mgdl = 28.7*a1c - 46.7;\nreturn { eagMgdl: mgdl, eagMmol: mgdl/18.0182, a1cOut: a1c };",
    "inputs": [
      {
        "name": "a1c",
        "type": "number",
        "default": 7,
        "min": 3,
        "max": 20,
        "step": 0.1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "eagMgdl",
        "precision": 0,
        "unit": "mg/dL"
      },
      {
        "name": "eagMmol",
        "precision": 1,
        "unit": "mmol/L"
      },
      {
        "name": "a1cOut",
        "precision": 1,
        "unit": "%"
      }
    ],
    "interpret": [
      {
        "max": 5.7,
        "key": "a1cNormal"
      },
      {
        "max": 6.5,
        "key": "a1cPrediabetes"
      },
      {
        "max": null,
        "key": "a1cDiabetes"
      }
    ]
  }
}
