ForHosting KIT · Math

Cylinder volume in liters

Turn a cylinder measured in centimeters into liters: a radius of 10 cm and a height of 40 cm hold 12.566371 liters. Made for water tanks, canister filters, kegs, cisterns and laboratory vessels. 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
10
Height
40
You get
Volume liters
12.566371

Water tanks, filter housings, laboratory vessels, kegs and rain barrels are all cylinders, and in the metric world their capacity is wanted in liters while the tape measure reads centimeters. This capability answers exactly that conversion in one deterministic call: you send the radius of the base and the height, both in centimeters, and you get back the volume in liters — the cylinder volume πr²h in cubic centimeters, divided by the exact definition of 1000 cubic centimeters per liter.

From centimeters to liters: the math

With the radius r and the height h both measured in centimeters, that formula yields cubic centimeters directly — a unit older literature calls the milliliter or cc. The conversion to liters is not an approximation but an exact definition of the metric system: one liter is exactly 1000 cubic centimeters, the volume of a cube ten centimeters on a side.

If what you measured is the diameter rather than the radius, halve it before calling; sending the diameter as the radius would overstate the volume by a factor of four, because the radius enters the formula squared. And if your measurements are in millimeters or meters, convert them to centimeters first: ten millimeters make a centimeter, a hundred centimeters make a meter, and mixing units is the single most common source of a thousandfold error in this computation.

Where liters-from-centimeters shows up

Capacity in liters is a daily question anywhere the metric system is the working standard, and centimeters are the natural unit of a ruler or tape measure on tanks and vessels.

Aquarists size tanks, sumps and canister filters; brewers and winemakers verify the working volume of fermenters and kegs; pool and irrigation contractors estimate the capacity of cylindrical cisterns and rain barrels; laboratory and process technicians compute the fill volume of columns, reactors and graduated vessels; and anyone buying a water butt, a fuel drum or a stock tank wants to know what the manufacturer's dimensions actually hold.

A standard 200-liter drum is the classic sanity check: a radius of about 29 centimeters and a height near 88 centimeters give almost exactly 200 liters.

Check aquarium and filter capacity

Get the true liter capacity of a cylindrical tank, sump or canister filter from its radius and height in centimeters before stocking or dosing.

Size brewing and fermentation vessels

Verify how many liters a fermenter, keg or barrel actually holds from two tape-measure readings in centimeters.

Compute cistern and drum volume

Estimate the liters contained in a rain barrel, water cistern or 200-liter drum from its cylindrical dimensions.

My measurements are in millimeters or meters. What do I do?

Convert them to centimeters first: divide millimeters by 10, multiply meters by 100. Mixing units is the most common cause of a thousandfold error.

I measured the diameter, not the radius. What do I send?

Divide the diameter by two first. The formula is πr²h, and sending the diameter as the radius would give four times the true volume.

Can I control the precision?

Yes. The optional decimals field sets the decimal places of the result, from 0 to 12, with six as the default. Rounding is half-up.

Why is the volume divided by 1000?

Because one liter is exactly 1000 cubic centimeters, the volume of a cube ten centimeters on a side. The cylinder's volume in cubic centimeters divided by 1000 gives liters with no approximation.

How can I check the result against a 200-liter drum?

A standard drum has a radius of about 29 centimeters and a height near 88 centimeters. Entering those gives almost exactly 200 liters, a quick check that your own readings make sense.

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/math/cylinder-volume-liters

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/math/cylinder-volume-liters \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"radius":10,"height":40}'
{
  "radius": 10,
  "height": 40
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.cylinder_volume_liters",
  "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.

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.

Both inputs are validated as positive finite numbers before any arithmetic runs, and anything else is rejected with a typed invalid_input error that names the offending field, so a bad measurement never turns into a silently wrong capacity figure.

From centimeters to liters: the math

A right circular cylinder is a circle extruded along a straight axis, so its volume is the area of the base times the height: V = πr²h. This endpoint therefore computes πr²h and divides by 1000 — no empirical factors, no lookup tables, no temperature corrections.

Validation, precision and rounding

The two inputs are checked before any arithmetic: both radius and height must be positive finite numbers. Once the inputs pass, the volume is computed in double precision and rounded to the requested number of decimal places — six by default, anywhere from zero to twelve via the optional <em>decimals</em> field — using a half-up rule applied to the absolute value. Zero, a negative value, a missing field, an unparseable string, NaN or infinity are all rejected with a typed <em>invalid_input</em> error whose message names the field at fault — an error that is never billed, because it is the caller's data that failed, not the service. Numeric strings such as "12.5" are accepted and coerced, which makes the endpoint friendly to form data and query parameters. The response echoes the exact radius and height that were used, so a single payload is a complete record of what was computed.

Where liters-from-centimeters shows up

The capability runs as a pure function on our global edge: nothing is stored, nothing is sent to any third party, and the same code that answers paid API calls runs free in your browser on this page, so you can check a measurement interactively before automating anything. At $0.002 per request with no per-unit component, a batch job that sweeps thousands of candidate dimensions — for example sizing a tank against a capacity target — costs exactly what the catalog says, with no surprises.

What does it cost?

$0.002 per request, with no per-unit component. It is also free to run in your browser on this page.

Which units does it use?

Radius and height are in centimeters. The cylinder volume is computed in cubic centimeters and converted with the exact definition 1 liter = 1000 cubic centimeters.

What input is rejected?

Anything that is not a positive finite number: zero, negative values, non-numeric strings, NaN, infinity and missing fields all return a typed invalid_input error.

Read the full KIT documentation →