Calculator methodology
Last updated: April 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² × Hwheresis the edge length. The calculator derivessfrom the user-supplied face-to-face width.
See the aquarium-volume calculator for an interactive version that handles all four.
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 standard rule of thumb is 3–5 watts per gallon for a tropical (76–80°F) tank in a typical room (68–72°F). The calculator scales this based 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× tank turnover per hour for community freshwater. So a 30-gallon tank wants a filter rated 120–240 GPH. The math is simple, but 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. Plan accordingly: pick a filter rated 6× if you actually want 4×.
- 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:
- Parameter compatibility — temperature, pH, and GH ranges for every species must overlap. Picks a viable common window or flags the conflict.
- 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).
- 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.
- Schooling minimums — schooling species (tetras, danios, rasboras) flag when count is below the minimum group size for that species.
- 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 water parameters (temp, pH, GH ranges, adult length) — primary source is FishBase, cross-referenced against established hobbyist references (Aquarium Co-Op species pages, Practical Fishkeeping). Where FishBase ranges are wider than typical hobbyist ranges, we report the hobbyist range with the FishBase max as a cap.
- Heater wattage rules — Eheim, Fluval, Aqueon spec sheets cross-checked against community testing (e.g., The2Hr Aquarist).
- Filter GPH ratings— manufacturer rated GPH from product spec sheets; the "real-world ~70%" adjustment comes from independent flow-meter testing posted by hobbyists, averaged across HOB, canister, and sponge filters.
- 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.