# Horizontal Tank Volume Calculator

> Computes the liquid volume in a horizontal cylindrical tank from its diameter, length and the measured liquid depth, using the circular-segment area for flat ends and adding two spherical-cap segments for hemispherical ends, plus total capacity, fill percentage and remaining ullage.

- Calculator id: `horizontal-tank-volume` · Category: Engineering & Automotive (`engineering`) · Tool name: `calculate_horizontal_tank_volume`
- Canonical page: https://tttkmbb.com/engineering/horizontal-tank-volume · This document: https://tttkmbb.com/engineering/horizontal-tank-volume.md · JSON definition: https://tttkmbb.com/engineering/horizontal-tank-volume.json

## Purpose

Computes the liquid volume in a horizontal cylindrical tank from its diameter, length and the measured liquid depth, using the circular-segment area for flat ends and adding two spherical-cap segments for hemispherical ends, plus total capacity, fill percentage and remaining ullage.

**Use when:** You need to convert a dipstick or sight-glass reading on a horizontal fuel, water, oil or chemical tank into litres or gallons, or want the tank's total capacity.

**Do not use when:** The tank stands vertically or is rectangular (volume is simply area × depth; use cylinder or rectangular-prism), has dished or elliptical (2:1) heads, or is not level.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `diameter_m` | number | m | required | Internal diameter of the cylindrical shell in metres (1 ft = 0.3048 m, 1 in = 0.0254 m). (> 0, max 100) |
| `length_m` | number | m | required | Length of the straight cylindrical section in metres, excluding the end caps. (> 0, max 1000) |
| `liquid_level_m` | number | m | required | Depth of liquid measured vertically from the bottom of the tank, 0 to diameter_m. (min 0, max 100) |
| `end_type` | enum: flat \| hemispherical |  | optional, default "flat" | Shape of the two end caps. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `liquid_volume_m3` | number | m³ | Volume of liquid at the given level. |
| `liquid_volume_liters` | number | L | Liquid volume in litres (1 m³ = 1000 L). |
| `liquid_volume_gal_us` | number | gal (US) | Liquid volume in US gallons (1 gal = 3.785411784 L). |
| `total_volume_m3` | number | m³ | Volume of the full tank including the end caps. |
| `total_volume_liters` | number | L | Full-tank capacity in litres. |
| `total_volume_gal_us` | number | gal (US) | Full-tank capacity in US gallons. |
| `fill_percent` | number | % | liquid volume / total volume × 100. |
| `empty_volume_liters` | number | L | Volume still available: total minus liquid. |
| `level_percent` | number | % | liquid_level_m / diameter_m × 100 (the height fraction, which is not the volume fraction). |

## Formula

`r = diameter_m / 2, h = liquid_level_m; segment area A = r² · acos((r − h) / r) − (r − h) · √(2·r·h − h²); cylinder liquid volume = A × length_m; hemispherical ends add π·h²·(3·r − h)/3 (a spherical cap of height h; the two half-spheres together form one sphere); total = π·r²·length_m (+ 4/3·π·r³ for hemispherical ends); fill_percent = liquid / total × 100`

Exact geometry for a level tank with a true cylindrical shell; wall thickness, internal fittings and dished (torispherical or 2:1 elliptical) heads are not modelled, so hemispherical is an upper bound for domed heads. Volumes are geometric and do not account for thermal expansion of the liquid.

## Data Sources

- Wikipedia – Circular segment — https://en.wikipedia.org/wiki/Circular_segment (reference, retrieved 2026-09-24)
- Wikipedia – Spherical cap — https://en.wikipedia.org/wiki/Spherical_cap (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/horizontal-tank-volume?diameter_m=…&length_m=…&liquid_level_m=…`
- `POST https://tttkmbb.com/api/v1/calculate/horizontal-tank-volume` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/horizontal-tank-volume · OpenAPI operationId `calculate_horizontal_tank_volume` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "horizontal-tank-volume", "inputs": {…}}`

## Example

- 2 m diameter, 5 m long, 0.5 m of liquid, flat ends: inputs `{"diameter_m":2,"length_m":5,"liquid_level_m":0.5,"end_type":"flat"}` → `{"liquid_volume_m3":3.0709,"liquid_volume_liters":3070.9,"liquid_volume_gal_us":811.3,"total_volume_m3":15.708,"total_volume_liters":15708,"fill_percent":19.55,"empty_volume_liters":12637,"level_percent":25}`
- 3 m diameter, 6 m shell, 2 m of liquid, hemispherical ends: inputs `{"diameter_m":3,"length_m":6,"liquid_level_m":2,"end_type":"hemispherical"}` → `{"liquid_volume_m3":40.5082,"liquid_volume_liters":40508.2,"total_volume_m3":56.5487,"fill_percent":71.63,"level_percent":66.67}`

```
GET https://tttkmbb.com/api/v1/calculate/horizontal-tank-volume?diameter_m=2&length_m=5&liquid_level_m=0.5&end_type=flat
```

## Limitations

The tank stands vertically or is rectangular (volume is simply area × depth; use cylinder or rectangular-prism), has dished or elliptical (2:1) heads, or is not level. Exact geometry for a level tank with a true cylindrical shell; wall thickness, internal fittings and dished (torispherical or 2:1 elliptical) heads are not modelled, so hemispherical is an upper bound for domed heads. Volumes are geometric and do not account for thermal expansion of the liquid. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is a half-full dipstick reading not 25 % of the volume at a quarter of the diameter?**

The cross-section is a circle, so the volume per centimetre of depth is smallest near the bottom and top and largest at the centre; at 25 % of the diameter a flat-ended tank holds only about 19.6 % of its volume.

**Does length_m include the end caps?**

No. Enter the straight shell length; hemispherical heads add their own volume automatically (each head extends by the tank radius).

**My tank has dished (torispherical) heads.**

Dished heads hold less than hemispherical ones (roughly 8–10 % of the cylinder volume per pair of 2:1 elliptical heads on a tank with L = 2D). Use flat and hemispherical as lower and upper bounds, or the manufacturer's strapping chart.

## Related

- [Cylinder Calculator](https://tttkmbb.com/geometry/cylinder.md) — Volume and surface area of a full cylinder.
- [Circle Sector and Segment Calculator](https://tttkmbb.com/math/circle-sector.md) — Area of the circular sector and segment used here.
- [Pipe Flow Calculator (Hazen–Williams)](https://tttkmbb.com/engineering/pipe-flow.md) — Flow and pressure drop in the pipe filling or draining the tank.
