Barrel volume calculator
Estimate how much a barrel or cask holds from three measures, end radius, bulge radius and height, with V = πh/3 · (2R² + r²). The tool also shows the two cylinders the barrel sits between. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Radius of the top
- 2
- Radius at the middle
- 3
- Height
- 10
- Volume
- 230.3834612633
- Cylinder volume at top
- 125.6637061436
- Cylinder volume at middle
- 282.7433388231
A wooden barrel or metal cask is not a perfect cylinder: the staves bow outward so the middle (bilge) is wider than the ends. Practical volume estimates therefore need three lengths, not two. Given a non-negative top end radius r, a non-negative middle radius R, and a positive height h, the classical standard barrel formula returns volume V equals π h over three times (two R squared plus r squared). That closed form is the same estimate used in school problems, cellar takeoffs, and quick packaging checks when you do not have a full stave spline or hydrostatic survey. When middle equals top the expression collapses to the right-cylinder volume π r squared h, so the calculator stays consistent with a plain drum.
What the standard barrel formula means
The standard barrel model treats the cask as a solid of revolution whose ends share one radius r and whose midsection has radius R, with axial height h measured along the axis of the staves. The volume formula V equals (π h / 3) times (2 R squared plus r squared) is the classical three-measure estimate used when you know end radius, bilge radius, and height but not a full generating curve.
It is related to the idea of averaging cross-sections: the middle disk is weighted more heavily than the ends because most of the length near mid-height is closer to the bulge. When R is larger than r the volume sits between the smaller cylinder of radius r and the larger cylinder of radius R; the closed form lands at one-third of two times the middle base area plus the end base area, all multiplied by height.
Length units must match: metres for r, R, and h yield cubic metres; inches yield cubic inches. Zero end radius is allowed under this contract as a mathematical edge case (a closed tip in the estimate), but a negative radius cannot describe a physical end or bilge and is rejected. Height must be strictly positive so the solid has extent.
The arithmetic is a handful of multiplications after coercion—no iteration, no Monte Carlo sampling, no dependence on wall-clock time, and no need for stave angles or cooperage drawings in the input.
Practical tips, limits, and related searches
When teaching, prefer paired examples: top radius two, middle radius three, height ten for a bulging cask; top equals middle for a cylinder regression against π r squared h; and a negative radius to demonstrate the hard rejection path. Prefer this tool when you already know the three classical measures and need a deterministic estimate in one shot.
Round-trip checks are easy: when middle equals top, confirm that volume matches cylinder volume within floating tolerance; when middle exceeds top, confirm that volume lies strictly between the end cylinder and the middle cylinder for the same height. If you need only a right cylinder with no bilge, use the dedicated cylinder volume calculator; if you need ellipsoid or prism volumes, use those sibling geometry tools instead of forcing a degenerate barrel.
What you can do with it
Winery, brewery, and cellar capacity sketches
Turn measured top radius, middle bulge, and stave height into a quick cubic capacity estimate before ordering or allocating storage.
Packaging and manufacturing takeoff scripts
Validate drum-like or barrel-like stock dimensions in scripts: volume for fill estimates, plus cylinder comparisons at end and bilge radii.
FAQ
What is the standard barrel volume formula?
With top end radius r, middle (bilge) radius R, and height h, volume is (π·h/3)·(2·R²+r²). All three lengths must use the same unit.
What happens when middle radius equals top radius?
The formula reduces to the right-cylinder volume π·r²·h. That identity is a useful regression check for teaching and automated tests.
Why are negative radii rejected?
A physical end or bilge cannot have a negative radius.
Does this handle unequal top and bottom ends?
No. This tool uses the classical equal-end barrel model with one end radius plus middle radius and height. Unequal ends need a different solid model.
Is the barrel volume calculator free?
The browser tool is free and runs locally.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geom/barrel \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"top_radius":2,"middle_radius":3,"height":10}'const res = await fetch("https://api.kit.forhosting.com/geom/barrel", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"top_radius": 2,
"middle_radius": 3,
"height": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/barrel",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"top_radius": 2,
"middle_radius": 3,
"height": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/barrel", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"top_radius":2,"middle_radius":3,"height":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"top_radius":2,"middle_radius":3,"height":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/barrel", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"top_radius": 2,
"middle_radius": 3,
"height": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.barrel",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_radius | 1000000000000 |
min_radius | 0 |
max_height | 1000000000000 |
min_height | 1e-15 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
This capability packages the identity as deterministic JSON with no computer-algebra system, no random seeds, and the same pure solve function in the free browser tool and the prepaid API path. Negative radii are rejected with invalid_input so scripts and grading pipelines see an honest error instead of a silent absolute value.
How to call the API and what comes back
All three must be finite numbers inside the published limits, with radii greater than or equal to zero and height strictly greater than zero. Use it from geometry homework pipelines, winery and brewery capacity sketches, interview-prep sandboxes, packaging takeoff scripts, or any workflow that needs reproducible barrel numbers without installing a computer-algebra package on every machine. Send a JSON body with top_radius, middle_radius, and height. Field top_radius is the non-negative end radius (top and bottom are equal under this model); aliases r_top, top, r, and end_radius are accepted. Field middle_radius is the non-negative bilge or bulge radius; aliases r_middle, middle, R, and bulge_radius map to the same meaning. Field height is the positive axial height; aliases h and H work. On success the response echoes top_radius, middle_radius, and height; returns volume as the primary result; includes cylinder_volume_at_top and cylinder_volume_at_middle as comparison cylinders with the same height; sets method to standard_barrel; and documents the closed form in a short formula block. Failed validation—missing a required field, a non-finite number, a negative radius, a non-positive height, or a value outside published limits—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price. Pair the call with unit conversion only when your source data mixes millimetres and metres; this capability does not convert linear units for you, so keep r, R, and h in the same unit before you send the request.
Practical tips, limits, and related searches
Keep radii and height inside the published range up to one trillion so intermediate products stay finite in IEEE double precision on the Worker and in the browser. Because the formula only needs three scalars, students can recompute by hand for nice fractions of π and match the API line by line after dividing reported floats by π if desired. This landing targets people searching for a barrel volume calculator or cask volume from top radius, middle radius, and height; it is not a pure frustum-of-cone tool with unequal ends and no bilge, nor a hydrostatic ullage table for partially filled barrels. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when users type impossible measures while learning the contract.
Integration use cases
Homework checks for barrel and cask volume
Give students end radius, bilge radius, and height; compare their hand-computed standard barrel volume against a deterministic API or free browser result.