{
  "schemaVersion": 1,
  "slug": "garbage-bag-size-calculator",
  "category": "cleaning",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "e33b69f8ce32c147289ba9d178e88cfc1d2fec62d6727030734fc3e97cebaa8c",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/garbage-bag-size-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": "rec = 1.5 x V; bags/wk = n x c; bags/yr = bags/wk x 52; overlap = (S - V)/V x 100; C = bags/yr x p",
    "vars": [
      [
        "V",
        "bin volume (gal)"
      ],
      [
        "S",
        "bag size (gal)"
      ],
      [
        "n",
        "number of bins"
      ],
      [
        "c",
        "bag changes per week"
      ],
      [
        "p",
        "price per bag"
      ],
      [
        "C",
        "annual cost"
      ]
    ],
    "note": "Suggested bag capacity = 1.5 × bin volume; this is a rim-overhang planning heuristic, and actual bag dimensions determine fit. Annual bags = bins × changes per bin per week × 52."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "simplehuman — Liners matched to bin models",
        "url": "https://www.simplehuman.com/products/custom-fit-liners-code-b-white"
      }
    ],
    "referenceRole": "input",
    "implementationHash": "e33b69f8ce32c147289ba9d178e88cfc1d2fec62d6727030734fc3e97cebaa8c",
    "basis": "rec = 1.5 x V; bags/wk = n x c; bags/yr = bags/wk x 52; overlap = (S - V)/V x 100; C = bags/yr x p",
    "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 recommended = binVolume*1.5; const bagsWeek = binCount*changesPerWeek; const bagsYear = bagsWeek*52; const overlap = binVolume > 0 ? (bagSize - binVolume)/binVolume*100 : 0; return { recommendedBagSize: recommended, fits: bagSize >= binVolume ? (bagSize >= recommended ? 'Yes — comfortable fit' : 'Yes, but tight on the rim') : 'No — too small', bagsPerWeek: bagsWeek, bagsPerYear: Math.round(bagsYear), annualCost: bagsYear*bagPrice, overlap: overlap };",
    "inputs": [
      {
        "name": "binVolume",
        "type": "number",
        "default": 13,
        "min": 1,
        "max": 500,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "binCount",
        "type": "number",
        "default": 3,
        "min": 1,
        "max": 200,
        "step": 1,
        "slider": true
      },
      {
        "name": "changesPerWeek",
        "type": "number",
        "default": 3,
        "min": 0.5,
        "max": 50,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "bagSize",
        "type": "number",
        "default": 13,
        "min": 1,
        "max": 500,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "bagPrice",
        "type": "number",
        "default": 0.15,
        "min": 0,
        "max": 50,
        "step": 0.01,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "recommendedBagSize",
        "precision": 1,
        "unit": "gallons"
      },
      {
        "name": "fits",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "bagsPerWeek",
        "precision": 1,
        "unit": ""
      },
      {
        "name": "bagsPerYear",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "annualCost",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "overlap",
        "precision": 0,
        "unit": "%"
      }
    ],
    "interpret": null
  }
}
