{
  "schemaVersion": 1,
  "slug": "dilution-ratio-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "e6a76c46c2ff9f7873fdaefc2cbd72623635c7a1c331146c85762a6728135a03",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/dilution-ratio-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": "C = V × A ÷ (A + B); W = V − C; P = A ÷ (A + B) × 100",
    "vars": [
      [
        "A",
        "parts of concentrate"
      ],
      [
        "B",
        "parts of water"
      ],
      [
        "V",
        "total volume"
      ],
      [
        "C",
        "concentrate volume"
      ],
      [
        "W",
        "water volume"
      ],
      [
        "P",
        "concentrate percentage"
      ]
    ],
    "note": "Total parts = A+B; P is the concentrate percentage. Mixing A parts concentrate with B parts water gives the stated split of V."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "CDC — Dilution and product-label precautions",
        "url": "https://www.cdc.gov/hygiene/about/cleaning-and-disinfecting-with-bleach.html"
      }
    ],
    "referenceRole": "input",
    "implementationHash": "e6a76c46c2ff9f7873fdaefc2cbd72623635c7a1c331146c85762a6728135a03",
    "basis": "C = V × A ÷ (A + B); W = V − C; P = A ÷ (A + B) × 100",
    "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 a=Number(ratioA),b=Number(ratioB),v=Number(totalVolume),totalParts=a+b;if(![a,b,v].every(Number.isFinite)||a<0||b<0||v<=0||totalParts<=0)return{concentrate:null,water:null,concentratePct:null,totalParts:null,__error:'inputError'};const concentrate=v*a/totalParts;return{concentrate,water:v-concentrate,concentratePct:a/totalParts*100,totalParts};",
    "inputs": [
      {
        "name": "ratioA",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 1000,
        "step": 1,
        "slider": true
      },
      {
        "name": "ratioB",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 10000,
        "step": 1
      },
      {
        "name": "totalVolume",
        "type": "number",
        "default": 5,
        "min": 0.01,
        "max": 10000,
        "step": 0.01
      }
    ],
    "outputs": [
      {
        "name": "concentrate",
        "precision": 3,
        "unit": "L"
      },
      {
        "name": "water",
        "precision": 3,
        "unit": "L"
      },
      {
        "name": "concentratePct",
        "precision": 2,
        "unit": "%"
      },
      {
        "name": "totalParts",
        "precision": 0,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
