{
  "schemaVersion": 1,
  "slug": "sunscreen-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "37097f151e01a815a46038eaf4fbfd5b4bf6c1bedc73c7b440a2f9698d142130",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/sunscreen-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": "Q = c × 29.5735; A = max(1, ceil(h ÷ 2)); total = Q × A",
    "vars": [
      [
        "c",
        "Amount per application (US fl oz)"
      ],
      [
        "h",
        "Hours in sun"
      ],
      [
        "Q",
        "Amount per application (mL)"
      ],
      [
        "A",
        "Applications"
      ]
    ],
    "note": "c is fluid ounces per application: body/children 1, face and neck 0.15, arms 0.35. Partial-area amounts are illustrative. The schedule omits earlier reapplication after swimming or sweating; follow the product label. No SPF or weight input is used."
  },
  "externalEvidence": {
    "reviewedAt": "2026-09-26",
    "sources": [
      {
        "name": "U.S. FDA — Sunscreen: How to Help Protect Your Skin from the Sun",
        "url": "https://www.fda.gov/drugs/understanding-over-counter-medicines/sunscreen-how-help-protect-skin-sun"
      },
      {
        "name": "U.S. FDA — Sun Protection Factor (SPF)",
        "url": "https://www.fda.gov/about-fda/center-drug-evaluation-and-research-cder/sun-protection-factor-spf"
      }
    ]
  },
  "contract": {
    "compute": "const amountOz = { body: 1, faceNeck: 0.15, arms: 0.35, kids: 1 }; const ouncesNeeded = amountOz[coverage] ?? 1; const mlNeeded = ouncesNeeded*29.5735; const applications = Math.max(1, Math.ceil(exposureHours/2)); return { ouncesNeeded, mlNeeded, applications, totalMl: mlNeeded*applications };",
    "inputs": [
      {
        "name": "coverage",
        "type": "select",
        "default": "body",
        "options": [
          {
            "value": "body"
          },
          {
            "value": "faceNeck"
          },
          {
            "value": "arms"
          },
          {
            "value": "kids"
          }
        ]
      },
      {
        "name": "exposureHours",
        "type": "number",
        "default": 4,
        "min": 0.5,
        "max": 12,
        "step": 0.5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "ouncesNeeded",
        "precision": 2,
        "unit": "oz"
      },
      {
        "name": "mlNeeded",
        "precision": 1,
        "unit": "ml"
      },
      {
        "name": "applications",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "totalMl",
        "precision": 0,
        "unit": "ml"
      }
    ],
    "interpret": null
  }
}
