About GallonMath

GallonMath helps home fishkeepers plan a freshwater or saltwater aquarium with explicit math for water volume, stocking, substrate, heater size and salinity. Each calculator shows the assumptions behind its result so a planning number is not mistaken for a species-specific care rule.

Tank volume is the starting point

The aquarium volume calculator converts dimensions to metres, computes the footprint for a rectangular, cylindrical, hexagonal, corner or bowfront tank, and applies the fill level. It also subtracts glass thickness and substrate depth when reporting net water. Litres and US gallons use the unit relationships published in NIST Special Publication 811, while water weight uses USGS water-density data.

Planning formulas with stated boundaries

Substrate mass is footprint area × bed depth × a selected dry bulk density. The heater tool uses water volume, the room-to-tank temperature difference, water's specific heat and an eight-hour warm-up assumption before rounding to common heater sizes. The stocking calculator starts from the Purdue Extension length-per-gallon guideline and applies bounded adjustments for filtration and planting. Salinity converts a temperature-adjusted specific-gravity reading against the UNESCO practical salinity reference.

How the math is checked

Automated reference cases verify several standard rectangular tank dimensions, cylinder and hexagon geometry, US-gallon and litre conversions, substrate displacement, heater energy, salinity adjustment and the stocking guideline's limits. These tests catch code regressions and inconsistent units; they do not inspect a real aquarium, calibrate a hydrometer or assess an animal's needs.

Limits and fish welfare

Nominal tank dimensions can differ from internal dimensions, and rockwork, equipment and irregular decor displace water beyond the modeled substrate bed. Heater demand changes with room drafts, lids, circulation and equipment heat. Most of all, fish length per gallon cannot model adult body mass, waste, territory, aggression, social group size or water chemistry. Treat stocking as an early planning screen, research every species, and confirm conditions with reliable measurements. Livestock is a responsibility.

Report a calculation problem

Email [email protected] with the calculator URL, the exact inputs and units, the result shown and what you expected. Include the public care, physical-data or standards source you checked when applicable.

Browse all aquarium calculators →