ForHosting KIT · Math

Tank volume calculator

Turn a dipstick or level reading into liquid volume for a horizontal or vertical cylindrical tank: a horizontal tank of radius 1 and length 10 filled to depth 1 holds 15.707963267949, exactly half its capacity. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Radius
1
Length
10
Fill depth
1
Tank axis orientation: horizontal
Horizontal
You get
Diameter
2
Filled volume
15.7079632679
Total volume
31.4159265359
Empty volume
15.7079632679

Cylindrical storage tanks appear in fuel depots, chemical plants, farms, and process skids in two common layouts: horizontal bullets lying on their side and vertical drums standing upright. Knowing how much liquid sits at a given dipstick or level-sensor reading is not the same as knowing the full geometric capacity—especially for a horizontal tank, where equal steps of liquid height do not add equal volumes because the circular cross-section widens then narrows.

Formulas for horizontal and vertical cylindrical tanks

Both orientations share the same total capacity: total volume equals π times radius squared times length, the volume of a right circular cylinder. What changes is how fill depth maps to liquid volume. For a vertical tank the free surface is a disk of radius r, so filled volume is simply π r squared times the liquid height h, provided h stays within the shell.

For a horizontal tank the free surface is a rectangle of length L and width equal to the chord at height h; the liquid cross-section is a circular segment. The classic closed form is A equals r squared times arccos of ((r minus h) over r) minus (r minus h) times the square root of (two r h minus h squared); filled volume is then A times L.

At h equals zero the segment area is zero; at h equals r the tank is half full; at h equals two r the segment becomes the full disk and the tank is full. Units stay consistent: if radius, length, and fill depth are metres, volumes are cubic metres; if inches, cubic inches. Convert to litres or US gallons only after the geometric volume is known.

This tool does not convert linear units for you, so keep all three dimensions in one unit system before you call. Heads, cones, and elliptical ends are out of scope—those shells need extra segment formulas beyond a pure right cylinder.

Practical tips, limits, and related searches

For vertical tanks also keep fill depth at or below length, the physical tank height. When teaching or debugging, prefer paired examples: radius one, length ten, fill depth one horizontal for a half-full horizontal bullet; radius two, length five, fill depth three vertical for a sixty-percent vertical drum; and fill depth three with radius one to demonstrate the diameter rejection path.

Because horizontal volume is nonlinear in height, a mid-level reading is half capacity only when fill depth equals the radius—not when fill percent of height is fifty percent in some other sense. This landing targets people searching for a tank volume calculator or horizontal and vertical cylindrical tank liquid volume from fill depth; it is not a full solid-cylinder surface-area tool, a barrel bilge estimator, or a unit converter.

Prefer this tool when you already know internal radius, axial length, and a dip or sensor height and need filled plus total volume in one shot. Round-trip checks are easy: full horizontal or vertical fill should match total volume within floating tolerance, empty fill should yield zero filled volume, and half-height horizontal fill at h equals r should yield half of total volume.

Fuel and chemical inventory from dipstick readings

Convert a measured liquid height in a horizontal or vertical cylindrical tank into filled volume and remaining capacity for stock and reorder decisions.

How is horizontal tank volume different from vertical?

Vertical filled volume is π·r²·h. Horizontal filled volume uses the circular segment area at height h times tank length L, so volume is nonlinear in liquid height.

What happens if fill depth exceeds the diameter?

Liquid height across a circular cross-section cannot exceed 2×radius; the tool does not clip or invent overfill.

What units should I use for radius, length, and fill depth?

Any consistent length unit. Volumes come back in the cube of that unit (m→m³, in→in³). Convert to litres or gallons after the geometric result.

Does this include tank heads, cones, or elliptical ends?

No. Only a right circular cylindrical shell is modelled. Dished heads and conical bottoms need extra segment formulas outside this contract.

Is the tank volume calculator free?

The browser tool is free and runs locally.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/geom/tank-volume

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/geom/tank-volume \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"radius":1,"length":10,"fill_depth":1}'
{
  "radius": 1,
  "length": 10,
  "fill_depth": 1
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geom.tank_volume",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_radius1000000000000
min_radius1e-15
max_length1000000000000
min_length1e-15
max_fill_depth1000000000000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

This capability takes a positive internal radius, a positive axial length (tank length when horizontal, tank height when vertical), a non-negative fill depth measured vertically from the bottom, and an orientation flag, then returns filled volume, total volume, empty volume, and fill fraction as deterministic JSON. Fill depth that exceeds the diameter is rejected with invalid_input so inventory scripts never invent liquid above the shell. The same pure solve runs free in the browser and on the prepaid API path, with no network calls, no random seeds, and no dependence on wall-clock time.

How to call the API and what comes back

Use it from inventory and gauge-table scripts, process engineering takeoffs, farm and fuel depot checks, interview-prep sandboxes, or any workflow that needs reproducible tank volumes without installing a computer-algebra package on every machine. Send a JSON body with radius, length, and fill_depth. Field radius is the positive internal radius; aliases r and R are accepted. Field length is the positive axial length of the cylinder—the tank length when horizontal and the upright height when vertical; aliases L, height, and h_tank map to the same meaning. Field fill_depth is the non-negative liquid height from the bottom; aliases depth, fill, h, and liquid_height are accepted. Optional orientation is horizontal or vertical and defaults to horizontal when omitted; aliases axis and position are accepted. On success the response echoes radius, length, fill_depth, diameter, and orientation; returns filled_volume, total_volume, empty_volume, fill_fraction, and fill_percent; and includes method plus a short formula block documenting the closed forms. Failed validation—missing a required field, a non-finite number, a non-positive radius or length, a negative fill depth, fill depth greater than the diameter, vertical fill above tank height, or a bad orientation string—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.

Practical tips, limits, and related searches

Keep radius and length inside the published positive range up to one trillion so intermediate products stay finite in IEEE double precision on the Worker and in the browser. Always enforce fill depth less than or equal to the diameter two times radius; the API rejects deeper readings with invalid_input rather than clipping silently. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when operators type impossible gauge readings while learning the contract.

Process engineering and gauge-table generation

Build or verify level-to-volume tables for bullets and drums by sweeping fill depth at fixed radius and length with deterministic API or browser results.

Homework and training for partial cylinder volumes

Give students radius, length, fill depth, and orientation; compare hand-computed circular-segment or πr²h volumes against a reproducible JSON answer.

Read the full KIT documentation →