Tank Volume Calculator › Methodology

Methodology

How this calculator computes tank volume — the formulas, the exact constants, the precise shape definitions, the assumptions, and the sources used to verify the maths. Last updated 2026-06-15.

Canonical units and how results are produced

Internally, every linear dimension is converted to centimetres and every volume is computed in litres, then converted to the display units. Working in one consistent internal unit keeps the geometry — especially the partial-fill maths — free of unit ambiguity. The displayed values are rounded for readability; the underlying calculation is not rounded until the final step.

Exact unit constants

The following constants are exact definitions (not measurements) and are used for every conversion on the site. The U.S. customary values follow the definitions in the NIST General Tables of Units of Measurement (see Sources):

ConstantExact value
1 inch2.54 cm (exact)
1 foot30.48 cm (exact)
1 litre1,000 cm³ (exact)
1 cubic metre1,000 litres (exact)
1 cubic foot28.316846592 litres (exact)
1 US liquid gallon3.785411784 litres (exact)
1 imperial (UK) gallon4.54609 litres (exact)
1 petroleum barrel42 US gallons = 158.987294928 litres
1 US 55-gallon drum55 US gallons ≈ 208.198 litres

A petroleum (oil) barrel is 42 US gallons. A 55-gallon steel drum is a different container of about 208 litres. The two are frequently confused; this site treats them as distinct.

Tank shapes and definitions

The calculator offers ten distinct geometries. The most important distinctions are between the rounded cross-sections, which are commonly confused:

Total-volume formulas

With r = radius, d = diameter, L = length, h = height, w = width, a = straight side-wall length of a capsule, R₁/R₂ = top/bottom radii of a frustum:

Vertical / horizontal cylinder: V = π r² L Rectangular / box: V = L w h Capsule (vertical / horizontal): V = π r² ( (4/3) r + a ) Oval stadium (r = h/2, a = w−h): V = ( π r² + 2 r a ) L True elliptical cross-section: V = ( π w h L ) / 4 Cone / frustum: V = ( π h / 3 ) ( R₁² + R₁ R₂ + R₂² ) Cone-bottom / cone-top: V = (cylinder) + (frustum section)

Partial-fill formulas

Partial fill (the volume of liquid at a given level) depends on orientation. The key cases:

Vertical tanks (cylinder, rectangle)

Filled volume scales linearly with the liquid height — half the height is half the volume.

Horizontal cylinder — circular segment

The liquid forms a circular segment. With fill depth f measured from the bottom:

θ = 2 · arccos( (r − f) / r ) A_segment = ½ r² ( θ − sin θ ) V_fill = A_segment · L (when f ≤ r) V_fill = V_total − (empty segment) (when f > r)

Using the empty segment above the half-way point avoids numerical error near the top of the tank. At exactly half full, the result is precisely half the total volume.

Capsule — circular segment plus spherical cap

For a horizontal capsule, the cylindrical body fills as a circular segment and the two hemispherical ends together fill as a single sphere, using the spherical-cap volume:

V_cap = (1/3) π h² ( 3R − h )

A vertical capsule is computed in three regions: the bottom hemisphere (spherical cap), the cylindrical middle, and the top hemisphere (total minus the empty top cap).

Oval stadium — composition

A stadium-section tank is treated as a horizontal cylinder of diameter h plus a rectangular slab of width a = w − h. The filled volume is the sum of the two filled to the same level — reusing the verified horizontal-cylinder segment maths.

True elliptical — affine-scaled segment

An ellipse is a circle scaled on one axis, so the filled cross-section of a true elliptical tank is the corresponding circular segment scaled by the ratio of the axes (w/h). At half full this returns exactly half the total volume, as it must by symmetry.

Cone, cone-bottom, cone-top — fill order

For a frustum, the radius at the liquid level is found by linear interpolation between the end radii, and the filled volume is the frustum from the bottom up to that level. Cone-bottom and cone-top tanks share the same total volume but fill differently: a cone-bottom tank fills the cone section first and then the cylinder above; a cone-top tank fills the cylinder first and then the cone on top. The calculator computes each as a piecewise function of the liquid level.

Verification & testing

Each formula is checked in an automated test suite against hand-worked values, including: total volume for every shape; partial fill at 0%, 25%, 50%, 75% and 100%; the exact-half symmetry of the horizontal cylinder, horizontal capsule and true ellipse (each must equal half the total); continuity of the capsule at its region boundaries; and the difference in fill order between cone-top and cone-bottom tanks. Invalid inputs (such as a non-positive dimension, a fill level greater than the tank height, an oval whose width does not exceed its height, or a cone whose end diameter is not smaller than its cylinder diameter) raise an error rather than returning a misleading number.

Assumptions and limitations

All results assume ideal geometry computed from the inside dimensions you enter. The calculator does not account for:

Results are estimates for planning and comparison. They are not intended for custody transfer, billing, or regulatory compliance, where a calibrated tank chart or certified measurement is required.

Sources

The geometry and the partial-fill methods were cross-checked against the following references:

Unit conversion constants are exact definitions of the inch, foot, gallon (US and imperial), litre, cubic foot and cubic metre.

Estimates only. This calculator computes ideal geometric volume from the dimensions you provide. It does not account for wall thickness, fittings, baffles, tilt, deformation, or manufacturing tolerances. For billing, custody transfer, or regulatory use, rely on a calibrated tank chart or certified measurement.