To calculate gallons in a rectangular or cylindrical tank, measure the inside dimensions, find the volume in cubic inches, then divide by 231.
Knowing the exact gallon capacity matters when sizing a fish tank, fuel drum, or custom reservoir. The math is straightforward, but the tank’s shape decides which formula you use. A rectangular tank is basic multiplication; a horizontal cylinder is the one that trips people up. Always measure the inside of the tank—wall thickness chews up usable volume, as does gravel or sand at the bottom.
Rectangular Tanks: Length × Width × Height
For a rectangular tank, measure the inside length, width, and height in inches. Multiply the three numbers to get the volume in cubic inches, then divide by 231, the number of cubic inches in one US gallon.
- Multiply Length × Width × Height to get cubic inches.
- Divide that result by 231 to get US gallons.
If you measure in feet, multiply the three dimensions to get cubic feet, then multiply by 7.48052 to convert straight into US gallons. A 2-foot by 1-foot by 1-foot tank is 2 cubic feet, or roughly 14.96 gallons. If only outside dimensions are available, subtract wall thickness from each dimension first; on glass aquariums the difference is small, but on welded steel or plastic tanks it can change your answer noticeably.
Cylindrical Tanks: The Pi Formula
For a vertical cylindrical tank, use V = π × r² × h. Measure the diameter, divide by 2 for the radius, and measure the height—both in the same unit. Plug into the formula for volume in cubic inches or cubic feet.
Convert the volume exactly as with rectangles: divide cubic inches by 231, or multiply cubic feet by 7.48052.
- Measure the diameter, then divide by 2 for the radius.
- Multiply π (3.1416) × radius-squared × height for the volume.
- Convert using the same 231 or 7.48052 factors.
The vertical cylinder is the easy variant. A horizontal cylinder tank is where people get burned.
What Changes for a Horizontal Cylinder
A horizontal cylindrical tank does not fill uniformly. The cross-section is a circle on its side, and the liquid occupies a circular segment rather than a full circle. The simple full-cylinder formula overstates volume whenever the tank is partially filled—a common scenario for fuel and water storage.
For a partially filled horizontal tank, filled volume depends on liquid depth and uses a circular-segment formula: segment area multiplied by the tank’s length, calculated from liquid depth relative to diameter via an inverse cosine function. This is more involved than basic multiplication, which is why a tank volume calculator proves its worth. CalculatorSoup’s tank volume calculator handles this without manual trig and includes separate options for horizontal and vertical tanks.
For irregular shapes, skip the geometry. Fill the tank with a known volume of liquid, or use a flow meter and read the total. Geometric formulas lose accuracy on non-standard shapes.
Why the 231 Number Is a Constant
The factor 231 comes from the definition of a US gallon: exactly 231 cubic inches. The 7.48052 figure is the same relationship in feet—one cubic foot holds 7.48052 US gallons.
These constants apply only to US customary gallons. An imperial gallon, used in the UK and some Commonwealth countries, is about 20% larger at 277.42 cubic inches. If your tank was built to imperial specs, the numbers won’t match. Always confirm which gallon standard you’re using before ordering pumps, fittings, or fuel, since the difference is significant.
| Unit | Volume in Gallons | Best For |
|---|---|---|
| 1 cubic inch | 0.00433 gallons | Small containers, aquariums |
| 231 cubic inches | 1 US gallon | The core conversion factor |
| 1 cubic foot | 7.48052 gallons | Large rectangular tanks |
| 1 imperial gallon | 1.20 US gallons | UK-built tanks and pumps |
Gravel, sand, fittings, and internal baffles all reduce usable volume. A fish tank with a thick substrate layer holds measurably less water than its empty volume suggests, so treat the geometric result as a theoretical maximum, not a perfect measurement.
For quick reference, the Pennsylvania DEP’s water tank volume calculator handles common shapes and applies the 231 conversion automatically.
If you’re sizing a compact storage solution, our roundup of the top 1-gallon air tanks covers rated capacities, portability, and build quality side by side.
FAQs
Do I measure the tank from the inside or the outside?
Always measure from the inside when possible. Wall thickness reduces usable volume, and on metal or steel tanks that difference is large enough to matter. If only outside dimensions are available, subtract wall thickness from each measurement before calculating.
Does gravel or sand affect my gallon calculation?
Yes. Substrate physically displaces water, so a tank with a thick gravel bed holds less water than its empty volume suggests. The calculated volume is the theoretical maximum; actual water capacity will be lower once you add substrate, decorations, or fittings.
How many cubic inches are in a US gallon?
Exactly 231 cubic inches. This constant is the basis for converting any volume in cubic inches to US gallons. The imperial gallon is larger at roughly 277.4 cubic inches, which is why UK measurements never match US numbers.
References & Sources
- CalculatorSoup. “Tank Volume Calculator.” Handles vertical, horizontal, and capsule tank shapes with a 231 cubic-inch conversion.
- Pennsylvania DEP. “Water Tank Volume Calculator.” Official state resource applying the US gallon conversion across common tank shapes.
- Gadgets Feed. “Best 1-Gallon Air Tanks.” Reviewed roundup of compact air tank options by rated capacity.
