Calculator methodology

Last updated: May 2026.

Every FishTankMath calculator runs the same standard tank-volume and water-chemistry math you'd find in any aquarium reference. This page documents the formulas, where the default values come from, the rules of thumb the calculators apply, and — equally important — what the calculators don't model.

Two related pages cover the surrounding parts: editorial policy covers how I source claims and corrections; disclosures covers monetization. This page is the math.

Tank volume formulas (4 shapes)

The base US-gallon conversion is fixed: cubic inches ÷ 231 = gallons (NIST definition). Liters use cubic centimeters ÷ 1000. Each tank shape uses a different formula for cubic inches:

  • Rectangular: L × W × H (in inches).
  • Bow-front: (L × W + bowDepth × L × π/4) × H. The bow adds a half-ellipse to the front face — semi-axes L/2 and bowDepth. The factor π/4 is just π/2 × 1/2 (half-ellipse area divided by 2 because we're multiplying by L, not L/2). Verify the half-ellipse approximation against your tank's actual bow profile if it's unusual; most commercial bow-fronts hit within 1% of this formula.
  • Cylindrical: π × r² × H.
  • Hex (regular): (3√3 / 2) × s² × H where s is the edge length. The calculator derives s from the user-supplied face-to-face width.

See the aquarium-volume calculator for an interactive version that handles all four.

Emergency water-quality calculators

The ammonia, nitrite, high-nitrate, fish-gasping, and new-tank syndrome calculators are triage tools. They do not diagnose disease or replace hands-on help; they turn test-kit readings into the next conservative math step.

  • Ammonia / nitrite emergency. Immediate water change percent is based on dilution math, then the Prime dose is calculated against full tank volume when the page invokes Seachem emergency-binding guidance. EPA / USGS ammonia-toxicity literature informs the pH-sensitive caution; manufacturer directions govern brand-specific binder claims.
  • Nitrite spike. The calculator combines dilution math with the standard chloride-blocking response for nitrite uptake, then suppresses aggressive salt guidance when the user flags salt-sensitive species.
  • High nitrate. The engine solves the dilution equation against source-water nitrate: change = (current - target) / (current - source). If source water is already at or above the target, the calculator says water changes alone cannot reach the goal.
  • Fish gasping. The diagnostic orders causes by immediately actionable risk: ammonia / nitrite, oxygen and surface agitation, acute pH stress, then disease referral when test readings do not explain the behavior.
  • New tank syndrome.The stage estimate uses days since setup plus ammonia / nitrite / nitrate readings to classify common cycle states. It is deliberately conservative because false "ready for fish" signals cause more harm than false delays.

Not veterinary advice — for sick fish or tank emergencies, consult an aquatic veterinarian or a qualified local aquarium professional.

Product-dose and equipment helpers

Product-specific calculators use the label or manufacturer spec sheet first. When the label does not answer the aquarium question directly, FishTankMath adds a visible assumption instead of hiding it in code.

  • Dechlorinator dosage. Dose is calculated against new water for routine water changes, because that is the water carrying chlorine or chloramine into the tank. Product rates come from manufacturer pages for Prime, API Stress Coat, Tetra AquaSafe, Fluval Aqua Plus, and Kordon Novaqua Plus.
  • Substrate. The calculator multiplies tank footprint by target bed depth, converts volume to dry weight using substrate-type density bands, then adds 10% buying margin for rinsing loss, slope, and decor displacement.
  • Water weight / floor load. Water weight uses NIST gallon conversion constants, then adds glass, substrate, decor, and stand estimates. Floor-load language uses the 40 lb/sq ft residential live-load reference as a planning comparison, not as a pass/fail structural inspection.
  • Air pump sizing. Baseline airflow is treated as a low-pressure freshwater-aquarium sizing heuristic. The calculator increases recommended flow for depth, multiple devices, and high surface-agitation needs; it does not model exact pump curves for every brand.

Working volume vs. gross volume

Manufacturer-stated gallons are computed from outside dimensions and assume the tank is full to the rim. Real fish-keeping volume is lower — typically 10–15% lower — because of:

  • Glass thickness:1/4" on small tanks, up to 5/8" on large ones. Inside dimensions are smaller than advertised outside dimensions.
  • Air space: the water line sits 1–2 inches below the rim to prevent splashing and accommodate the lid / hood.
  • Substrate displacement: 1–2 inches of substrate displaces 5–10% of the gross volume (more in tall narrow tanks).
  • Decor and equipment: hardscape, heater, filter intake — small but real.

All FishTankMath dosing and stocking math uses working volume(true water volume), not the marketed gallons. If you're reading a label that says "1 ml per 10 gallons," assume the label means working gallons too — most aquarium-product manufacturers do.

Water-change math

A percentage water change replaces that fraction of the tank's current water with fresh, dechlorinated, temperature-matched water. The arithmetic is simple — the part that matters is what the change actually does to dissolved compounds:

  • Removal ratio= the fraction changed. A 25% water change removes 25% of dissolved nitrate, ammonia, fish hormones, etc. — and replaces it with whatever's in your tap water.
  • To halve a parameter, you need a 50% water change. To remove 90%, you need either one 90% change or two consecutive 67% changes (compounded: 1 − 0.33² = 0.89).
  • Temperature matchingwithin ~2°F is the practical floor. Larger swings stress fish — particularly tropical species. Use a thermometer in the bucket; don't eyeball it.
  • Dechlorinationhappens at the dose listed on the bottle. Most North American tap water carries chlorine OR chloramine — chlorine evaporates; chloramine doesn't. Always dechlorinate.

See the water-change calculator for the per-tank gallons-out / gallons-in math.

Heater wattage

The hobby-baseline rule of thumb is 3–5 watts per gallonfor a tropical (76–80°F) tank in a typical 68–72°F room — that is, a small ΔT in the 5–10°F range. The live calculator engine scales watts/gallon by the actual temperature delta: 3 W/gal at the smallest deltas, ~5 W/gal at mid-range, ~7.5 W/gal as ΔT widens, and approaching 10 W/gal at the largest deltas (e.g., a tropical tank in a cold basement, or anything where ΔT > ~15°F). The aquarium heater buying guide uses the same 3 / 5 / 7.5 / 10 W/gal bracketing the engine applies. The calculator scales further on:

  • Target ΔT — how much above room temperature you need to hold the tank. Bigger ΔT = more watts.
  • Tank surface area — heat loss is dominated by the air-water surface and uninsulated glass. Tall narrow tanks hold heat slightly better than long shallow ones at the same gallons.
  • Tank lid / hood — open-top tanks lose heat roughly 2× as fast as covered tanks. Bump wattage 50% for open-top setups.

Use two smaller heaters (e.g., 2× 100W on a 75-gallon) rather than one large one for redundancy and more even heat distribution. See the heater-sizing calculator.

Filter turnover (GPH)

The standard target is 4–8× working turnover per hour for community freshwater (the actual flow you want through the tank, not the box rating). Working flow needs to be converted to box-rated GPH before shopping, because manufacturer ratings are measured with no media + no head height. The live filter engine multiplies working flow by ~1.5 to recover the rated GPH the box shows: a 30-gallon community tank at 6× working = 180 GPH working, which the calculator surfaces as roughly 270–360 GPH rated— that's the number to match against a filter spec page. Two practitioner-grade caveats:

  • Real-world GPH is ~70% of rated.Manufacturer ratings are measured with no media + no head height. Loaded media + a ~12-inch lift cuts flow by roughly a third. The 1.5× working → rated multiplier the engine uses bakes this in; if you size against a box-rated number directly, you'll under-spec real flow.
  • Bioload changes the target. Heavily stocked, messy fish (cichlids, goldfish) need 8–10× turnover. Low-flow species (betta, shrimp) want 3–4× max — high-flow filters stress them.

See the filter-flow calculator for the recommended GPH band given tank size + stocking density.

Stocking density (the real math, not the 1-inch rule)

The old "1 inch of fish per gallon" rule is unreliable and routinely under- or over-stocks tanks. Our stocking-density calculator runs five constraint checks against any selection:

  1. Parameter compatibility — temperature, pH, and GH ranges for every species must overlap. Picks a viable common window or flags the conflict.
  2. Predator-prey — checked species pairs that are known to predate each other (e.g., angelfish on neon tetras once the angelfish reaches adult mouth-size).
  3. Per-species tank-size minimum— fish that need swim space (e.g., 30+ gallon for a single goldfish) get tank-size-minimum checks against the user's working volume.
  4. Schooling minimums — schooling species (tetras, danios, rasboras) flag when count is below the minimum group size for that species.
  5. Bioload ratio — sum of per-species bioload factors (which scale with adult body mass, not length) divided by working volume. Caps below the species-specific limits for the filtration assumed.

See the stocking-density calculator for the live engine.

Where default values come from

  • Species data. FishBase for taxonomy, native distribution, and maximum adult size where the field is populated. Husbandry values (temperature, pH, GH ranges, lifespan in captivity, schooling minimums, aquarium-care notes) are synthesized from established hobby references — Aquarium Co-Op care guides, The Aquarium Wiki, Practical Fishkeeping, university extension publications — and labeled FishTankMath / hobby-practice ranges on each species page rather than carried over verbatim from FishBase fields that don't exist or aren't aquarium-care-specific. Where references diverge, the species page picks the answer that fails safest for a beginner's first batch.
  • Heater wattage rules.The 3 / 5 / 7.5 / 10 W/gal-by-ΔT bracketing is FishTankMath's rule, cross-checked against the published manufacturer sizing tables that ship with consumer aquarium heaters (Eheim Jäger, Fluval E-series, Aqueon Pro). Manufacturer tables vary slightly between brands; the tiered bracketing converges with all three at the small-ΔT end and diverges (toward higher wattage) at wider deltas.
  • Filter GPH ratings.Manufacturer rated GPH is published on product pages and product packaging. The "real-world ~70%" adjustment is the rule FishTankMath uses to convert rated to working flow; it's a hobby consensus number that surfaces consistently across keeper-published flow tests and matches FishTankMath's own observation across HOB, canister, and sponge filters. Treat the 70% figure as a working approximation, not a measured constant.
  • Substrate displacement factor — empirical measurement: 1 inch of standard pea-gravel-sized substrate displaces roughly 5% of tank volume per inch of bed depth. Larger grain (river rock) displaces slightly less; smaller (sand) slightly more.
  • Water gallon → liter / weight — NIST conversions: 1 US gal = 3.7854 L = 8.345 lbat 4°C. We use 4°C as the reference because that's the maximum-density point. Real tank water at 75°F is ~0.3% less dense — within measurement noise for all aquarium use cases.

Sourcing for narrative claims (manufacturer changes, hobbyist consensus shifts) follows the rules in editorial policy.

What the calculators don't model

Honest limitations matter more than feature lists. These are cases where the calculators above explicitly don't compute what you might assume:

  • Saltwater / reef chemistry.The calculators are freshwater-only. Salinity, alkalinity (KH), Ca²⁺ / Mg²⁺ dosing, and reef-specific water-change math aren't in scope.
  • Sick fish diagnosis.The calculators don't identify diseases, parasites, or treatments. For sick livestock, talk to an aquatic vet — that's outside what any math tool can do.
  • Real-time water-quality testing. The calculators give you dosing guidance, not measurement. You still need test strips or a liquid kit (API, Salifert) to know what your water actually contains.
  • Cycle dynamics. Cycling math depends on bio- media surface area, ammonia source, temperature, and seed bacteria — too many variables for a closed-form calculator. See the cycling guide for a process narrative instead.
  • Plant nutrient demand. Heavily-planted tanks have CO₂, NPK macro, and trace-element demand that competes with fish bioload for the same nitrate budget. Out of scope for the standard stocking calculator.
  • Aggression-driven stocking limits. Behavioral compatibility (territorial cichlids, fin-nippers near long-fin species, betta personality variance) is partial — we flag known patterns, but individual fish vary. Observe and have a divider / backup tank ready.

Review and update process

Every calculator and guide carries a per-entry update date based on actual material edits — not the build timestamp. Standing review cadence:

  • Quarterly — species data is sanity-checked against current FishBase entries and hobbyist consensus shifts. Aggression-level updates apply when published behavioral research changes.
  • On manufacturer change — when a heater / filter manufacturer changes published specs (rated GPH, wattage curves), affected pages get updated immediately.
  • On research correction— when published fish-keeping science shifts (e.g., a species' preferred parameter range gets re-measured), the calculator default adjusts and the date stamp bumps.

Corrections process and conflict-of-interest disclosures are in editorial policy.