{
  "schemaVersion": 1,
  "slug": "pool-salt-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "b8ed76959b7a63c63ff4402391a572d189e3df8c11dcf12170f1e655fc9944fe",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/pool-salt-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_lb = G × max(0, ppm_t − ppm) ÷ 120000; bags = ceil(S_lb ÷ s)",
    "vars": [
      [
        "S_lb",
        "Salt needed (lb)"
      ],
      [
        "G",
        "Pool volume (gal)"
      ],
      [
        "ppm_t",
        "Target salt (ppm)"
      ],
      [
        "s",
        "Source unit code"
      ],
      [
        "bags",
        "Bags to buy"
      ],
      [
        "ppm",
        "Current salt level (ppm)"
      ]
    ],
    "note": "kg = lb × 0.45359237; bags rounded up (default 40 lb)."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "Pentair — Salt chlorinator manual and operating salt range",
        "url": "https://www.pentair.com/en-us/products/residential/pool-spa-equipment/pool-water-treatment/intellichlor.html"
      }
    ],
    "referenceRole": "input",
    "implementationHash": "b8ed76959b7a63c63ff4402391a572d189e3df8c11dcf12170f1e655fc9944fe",
    "basis": "S_lb = G × max(0, ppm_t − ppm) ÷ 120000; bags = ceil(S_lb ÷ s)",
    "limitations": "Use the cited guidance and your own measurements, bills or product specifications to choose inputs. Sample defaults are not current local data."
  },
  "contract": {
    "compute": "const d = Math.max(0, targetPpm-currentPpm); const saltLb = gallons*d/120000; return { saltLb, saltKg: saltLb*0.45359237, bags: Math.ceil(saltLb/(bagSize || 40)), note: 'Add in two or three doses with the pump running so the salt dissolves evenly' };",
    "inputs": [
      {
        "name": "gallons",
        "type": "number",
        "default": 15000,
        "min": 100,
        "max": 200000,
        "step": 100,
        "slider": true
      },
      {
        "name": "currentPpm",
        "type": "number",
        "default": 2200,
        "min": 0,
        "max": 6000,
        "step": 50,
        "slider": true
      },
      {
        "name": "targetPpm",
        "type": "number",
        "default": 3200,
        "min": 2000,
        "max": 5000,
        "step": 50,
        "slider": true
      },
      {
        "name": "bagSize",
        "type": "number",
        "default": 40,
        "min": 10,
        "max": 100,
        "step": 5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "saltLb",
        "precision": 1,
        "unit": "lb"
      },
      {
        "name": "saltKg",
        "precision": 1,
        "unit": "kg"
      },
      {
        "name": "bags",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "note",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
