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):
| Constant | Exact value |
|---|---|
| 1 inch | 2.54 cm (exact) |
| 1 foot | 30.48 cm (exact) |
| 1 litre | 1,000 cm³ (exact) |
| 1 cubic metre | 1,000 litres (exact) |
| 1 cubic foot | 28.316846592 litres (exact) |
| 1 US liquid gallon | 3.785411784 litres (exact) |
| 1 imperial (UK) gallon | 4.54609 litres (exact) |
| 1 petroleum barrel | 42 US gallons = 158.987294928 litres |
| 1 US 55-gallon drum | 55 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:
- Capsule — a cylinder with a hemispherical cap on each end. The cross-section through the body is a circle; the side profile is a stadium. Offered in vertical and horizontal orientations.
- Oval (stadium / obround) — a tank whose cross-section is a rectangle capped by two semicircles. This is the common “obround” fuel/oil tank. Offered horizontally.
- True elliptical cross-section — a tank whose cross-section is a genuine ellipse. This is different from a stadium oval, and also different from a cylindrical tank fitted with 2:1 elliptical or dished end-caps (heads). Cylindrical tanks with elliptical or dished heads concern the shape of the end domes and are a separate geometry, planned as a future enhancement and not offered here. Offered horizontally.
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:
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:
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:
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:
- wall thickness (enter inside dimensions for liquid capacity);
- internal fittings, baffles, heating coils or supports;
- tank tilt or being out of level;
- dents, bulging or deformation;
- manufacturing tolerances and real-world variation between tanks.
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:
- CalculatorSoup — Tank Volume Calculator (shape set, circular-segment and spherical-cap partial-fill methods, oval-as-composition approach): calculatorsoup.com.
- Wolfram MathWorld — Spherical Cap, V = ⅓πh²(3R−h): mathworld.wolfram.com.
- Wolfram MathWorld — Horizontal Cylindrical Segment: mathworld.wolfram.com.
- Hydraulic Institute — horizontal tank volume data tool (cross-check for horizontal cylinder and head methods): datatool.pumps.org.
- Math is Fun — Volume of a Horizontal Cylinder (segment method): mathsisfun.com.
- Frustum (truncated cone) volume — Wolfram MathWorld, Conical Frustum: mathworld.wolfram.com; and Wikipedia, Frustum: en.wikipedia.org/wiki/Frustum.
- Unit conversion constants — U.S. customary definitions follow the NIST General Tables of Units of Measurement, NIST Handbook 44, Appendix C: nist.gov.
Unit conversion constants are exact definitions of the inch, foot, gallon (US and imperial), litre, cubic foot and cubic metre.