Calculate the volume of a cylindrical tank or container in gallons, cubic feet, and liters from its diameter and height.
volume = π × (diameter ÷ 2)² × height
A cylinder's volume is pi times the radius squared times the height. One cubic foot holds about 7.48 US gallons.
For a partially filled horizontal tank the math is more complex — this covers a full vertical cylinder.
A cylindrical tank 4 ft in diameter and 6 ft tall has a volume of π x (2 ft)² x 6 ft = 75.4 cubic feet. At 7.48 gallons per cubic foot, that's about 564 gallons, or roughly 2,135 liters.
This is for a full vertical cylinder. A horizontal tank that's partially full needs a more complex partial-cylinder calculation, and tanks with domed or coned ends add volume at the ends. For those, treat this as the straight-side volume and add the end caps separately.
Exact geometry. One cubic foot is 7.48 US gallons; one US gallon is 3.785 liters.
Tank volume depends on geometry. A vertical cylinder is pi times the radius squared times the height; a horizontal cylinder uses the same cross-section times length. Rectangular tanks are length times width times height. The unit conversions matter most here: one cubic foot is about 7.48 US gallons, and one cubic meter is 1,000 liters.
The harder cases are partial fills and shaped ends. A horizontal cylinder filled partway uses a circular-segment formula, not a simple proportion, because the cross-section is not linear with depth. Tanks with dished or hemispherical end caps add the cap volumes to the cylindrical body. For a dipstick reading, the relationship between depth and volume is non-linear on any round horizontal tank.
About 564 gallons for a 4 ft diameter, 6 ft tall cylinder.
For a vertical cylinder, multiply pi by the radius squared by the height. For a horizontal cylinder, use the same circular cross-section times the length. Then convert cubic feet to gallons by multiplying by about 7.48.
About 7.48 US gallons per cubic foot. One cubic meter holds 1,000 liters, or about 264 US gallons.
Use the circular-segment formula on the cross-section, since volume is not proportional to depth on a round horizontal tank. The relationship between a dipstick depth and volume is non-linear.