{
  "schemaVersion": 1,
  "slug": "fish-tank-size-calculator",
  "category": "pets",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "58368c0b0534e69174eca50561db9e4b7f8462a3fe13c6005d487b9e0c1eaced",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/fish-tank-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": "L = s + 3m + 6g + 2b; Grec = 1.3 × f × L",
    "vars": [
      [
        "s",
        "small fish count"
      ],
      [
        "m",
        "medium fish count"
      ],
      [
        "g",
        "large fish count"
      ],
      [
        "b",
        "bottom-dweller count"
      ],
      [
        "L",
        "unitless model bioload score"
      ],
      [
        "Grec",
        "rough model gallon estimate"
      ]
    ],
    "note": "This uses arbitrary category weights and gallon multipliers as a rough heuristic, not a husbandry guideline. The bioload score is unitless; results omit adult size, behavior, tank footprint, filtration capacity and water quality."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "RSPCA — Fish welfare and species-specific tank needs",
        "url": "https://www.rspca.org.uk/adviceandwelfare/pets/fish"
      }
    ],
    "referenceRole": "context",
    "implementationHash": "58368c0b0534e69174eca50561db9e4b7f8462a3fe13c6005d487b9e0c1eaced",
    "basis": "L = s + 3m + 6g + 2b; Grec = 1.3 × f × L",
    "limitations": "The references provide context and limitations. They do not validate this page’s illustrative multipliers, lookup values or predictions."
  },
  "contract": {
    "compute": "const M = { tropical:1, goldfish:5, cichlid:2, betta:2.5, marine:3 }; const perInch = M[fishType] || 1; const bioload = smallFish*1+mediumFish*3+largeFish*6+bottomDwellers*2; const minimumGallons = bioload*perInch; const recommendedGallons = minimumGallons*1.3; return { bioload, minimumGallons, recommendedGallons, filterRating: recommendedGallons*4, note: fishType === 'goldfish' ? 'Goldfish are cold-water and produce a lot of waste — under-filtering is the most common mistake' : 'Cycle the tank before adding fish, and stock gradually over several weeks' };",
    "inputs": [
      {
        "name": "smallFish",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 500,
        "step": 1,
        "slider": true
      },
      {
        "name": "mediumFish",
        "type": "number",
        "default": 6,
        "min": 0,
        "max": 200,
        "step": 1,
        "slider": true
      },
      {
        "name": "largeFish",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true
      },
      {
        "name": "fishType",
        "type": "select",
        "default": "tropical",
        "options": [
          {
            "value": "tropical"
          },
          {
            "value": "goldfish"
          },
          {
            "value": "cichlid"
          },
          {
            "value": "betta"
          },
          {
            "value": "marine"
          }
        ]
      },
      {
        "name": "bottomDwellers",
        "type": "number",
        "default": 3,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "bioload",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "minimumGallons",
        "precision": 0,
        "unit": "gal"
      },
      {
        "name": "recommendedGallons",
        "precision": 0,
        "unit": "gal"
      },
      {
        "name": "filterRating",
        "precision": 0,
        "unit": "gal/h"
      },
      {
        "name": "note",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
