Cylinder Volume Calculator
Enter any two of diameter, height, and volume — the third solves instantly.
Worked examples
Rainwater collection drum capacity
A homeowner wants to know how many liters a cylindrical rain barrel holds before ordering a matching lid and spigot kit.
- D
- 2 m
- H
- 3 m
≈ 9.4248 m³ (9,424.8 L)
Sizing a mixing vat from a target capacity
A fabricator needs a cylindrical mixing vat that holds exactly 5,000 L and stands 1.8 m tall — what diameter should they cut the shell to?
- V
- 5,000 L
- H
- 1.8 m
≈ 1.88 m diameter
Radius mistaken for diameter on a parts-washer drum
A fabricator specs an 8 in diameter, 10 in tall parts-washer drum, but a spec-sheet field labeled "radius" gets the diameter typed into it by mistake.
- Correct D
- 8 in
- H
- 10 in
Correct 502.65 in³ (2.18 gal) — mistaken entry gives 2,010.62 in³, exactly 4×
How the formula works
A cylinder's volume is just the area of its circular cross-section multiplied by how far that circle extends — its height. The circle's area is π · r², where r is half the diameter, so stacking that constant cross-section up through height h gives the full formula below. Because there's only one equation with three quantities (D, H, V), knowing any two always pins down the third algebraically: solve the same equation for r (then double it for D) to get diameter from height and volume, or isolate h to get height from diameter and volume.
That "stack it up" idea is really integration in disguise: imagine slicing the cylinder into thousands of infinitesimally thin discs along its height, each with the same circular cross-section area π(D/2)². Because that area doesn't change from one slice to the next — unlike a cone or a dome, whose cross-section shrinks or bulges as height changes — adding up every slice is just that constant area multiplied by how many slices, i.e. the height, there are. It's the same reasoning behind Cavalieri's principle: any two solids with matching cross-sectional area at every height have the same volume, regardless of shape.
Radius mistaken for diameter: an exact 4× error
Because volume depends on radius squared, mixing up radius and diameter isn't a small rounding slip — it's always exactly a factor of four, in a fixed and predictable direction. If a diameter value gets typed into a field expecting the radius (or a spreadsheet formula uses D where it should use D/2), the radius used ends up twice what it should be, and since V ∝ r², doubling r quadruples V: (2r)² = 4r².
Concretely, an 8 in diameter, 10 in tall drum has a true radius of 4 in and a correct volume of π × 4² × 10 = 160π ≈ 502.65 in³ (2.18 gal). Enter 8 in as if it were the radius by mistake, and the same formula returns π × 8² × 10 = 640π ≈ 2,010.62 in³ (8.71 gal) — precisely four times too large, not a plausible "close enough" number that would slip past a casual sanity check. That predictability is useful: if a computed capacity looks suspiciously close to 4× (or 0.25×) what a similar container should hold, a radius/diameter mix-up is the first thing worth checking before anything else.
Unit mismatches: why mm and inches don't forgive a wrong guess
Volume scales with length cubed, so a unit mix-up doesn't inflate the answer by a simple, obvious multiple the way the radius/diameter error above does — it inflates it by that unit ratio cubed, which gets enormous fast. One inch is exactly 25.4 mm, so entering the same numeric values into fields set to inches instead of millimeters doesn't just shift a decimal point — it multiplies the volume by 25.4³ ≈ 16,387.
A small tube that's actually 50 mm in diameter and 200 mm tall holds π × 25² × 200 = 125,000π ≈ 392,699 mm³, or about 0.393 L. Enter those same numbers — 50 and 200 — with the unit selectors left on inches, and the calculator (correctly, given what it was told) computes a cylinder 1,270 mm across and 5,080 mm tall: roughly 6,435 L, or 6.4 m³. Nothing in the arithmetic is wrong in either case — the formula did exactly what the units said — which is why the fix isn't a better formula, it's checking the unit selector before trusting a surprising result, especially one that's off by a suspiciously large, round-looking multiple.
| Conversion | Exact factor |
|---|---|
| 1 in | 25.4 mm (exact) |
| 1 ft | 304.8 mm (exact) |
| 1 US gal | 3.785411784 L (exact) |
| 1 ft³ | 28.316846592 L (exact) |
Sources: length and volume conversion factors are SI/NIST-defined exact values — 1 in = 25.4 mm and 1 US liquid gallon = 231 in³ are definitional, not measured. The gallon and ft³ figures above are the same 25.4 mm and 0.3048 m inch/foot definitions carried through cubing (231 in³ × 25.4³ mm³/in³ = 3,785,411.784 mm³ = 3.785411784 L; 0.3048³ m³ = 0.028316846592 m³ = 28.316846592 L), matching this calculator's own internal unit-conversion tables.
Wall thickness: inside diameter vs. outside diameter
This calculator's V = π(D/2)²H formula assumes a solid cylinder — fine for a solid shaft or a fully-full tank, but a pipe, tube, or core is hollow, and the material itself only occupies the ring between its inside and outside diameters. Getting the wall-material volume (as opposed to the bore's capacity) means running the same formula twice and subtracting: once with the outside diameter for the full solid the piece would be if it had no bore, once with the inside diameter for the empty bore, and the difference is the actual material.
Take a steel pipe segment with a 100 mm outside diameter, a 5 mm wall thickness, and a 2 m length. The inside diameter is the outside diameter minus twice the wall thickness — 100 − (2 × 5) = 90 mm, not 95 mm — because the wall exists on both sides of the bore. Outer volume: π × 50² × 2,000 = 15,707,963 mm³. Inner (bore) volume: π × 45² × 2,000 = 12,723,450 mm³. The steel itself is the difference: 15,707,963 − 12,723,450 ≈ 2,984,513 mm³, or about 2.98 L — the figure a mill order or a shipping-weight estimate (material volume × the alloy's density) would actually start from, not the 15.7 L outer-envelope volume the plain formula alone would suggest.
Partial fill: why orientation changes everything
This calculator only handles a cylinder that's completely full, by design (see the FAQ below) — but it's worth understanding why a partially filled cylinder needs a different approach depending on which way it's standing, because the two cases behave nothing alike. Stand a cylinder on its circular end (vertical orientation) and the cross-section at every fill height is identical — the same circle — so a partial volume is simply this same formula with the liquid's height used in place of the full height: fill it to 25% of its height and you have exactly 25% of its volume. It's a straight line.
Lay that same cylinder on its side (horizontal orientation) and the cross-section the liquid occupies is a circular segment, not a full circle, and segments don't scale linearly with height at all. A tank filled to exactly half its diameter is exactly 50% full by symmetry, but a tank filled to a quarter of its diameter — which sounds like it should be roughly a quarter full — actually holds only about 19.5% of its capacity, because the circle is narrower near the bottom than it is at the midline. Reading a horizontal tank's dip level as if it scaled linearly with a vertical fill line understates how empty it really is below the midline and overstates it above. The Tank Volume Calculator handles both orientations and partial fill levels directly, and reading tank dip charts works through the segment geometry and strapping-chart approach this shortcut is built on.
Practical uses: pipe runs, vessels, and roll cores
The same D-H-V relationship shows up under several different names depending on the job. Sizing a straight pipe run's internal (bore) volume — for estimating purge volume before a fluid changeover, or dead-leg volume in a process line — is this formula applied with the pipe's inside diameter and run length; for the material itself rather than what's inside it, use the wall-thickness subtraction above. Sizing a mixing vessel, drum, or tote from its shell dimensions is the most direct use of the formula as-is, solving for volume from a known diameter and height, or for the required diameter or height from a target capacity, exactly as in the worked examples above.
A wound roll's core is a related but distinct case: the core itself is a short hollow cylinder, sized with the same OD/ID subtraction used for pipe wall material above. The roll wound around that core is a related annulus-geometry problem one level up — outer roll diameter minus core diameter, converted into unwound length rather than volume — which is what the Roll Length Calculator solves using the same "big circle minus small circle" cross-section this page uses for pipe walls.
Frequently asked questions
How do I use the "Solve for" toggle?
Pick whichever of diameter, height, or volume you don’t know — that field locks and displays the answer, while the other two become the fields you fill in. There’s no separate "calculate" step: as soon as both remaining fields have valid numbers, the locked field updates live.
Does it matter which two values I enter?
No — the volume formula V = πr²h is symmetric in the sense that any two of the three quantities pin down the third, so diameter+height, diameter+volume, and height+volume all work equally well. The math is exactly the same algebra rearranged three different ways; pick whichever two numbers you actually have on hand.
Why is one field grayed out and not editable?
That’s the field currently being solved for, shown as a live result rather than an input so it’s never ambiguous which two numbers are driving the calculation. You can still switch its unit to view the answer in a different scale — use the "Solve for" toggle above to solve for a different field instead.
Is this the same as the tank volume calculator?
No — this tool assumes a plain, fully-full cylinder with no dished/domed heads and no partial fill level; it's a straightforward sizing calculator for pipe stock, tubing, cans, or any round container's total capacity. If you need a partial fill level, dished or hemispherical heads, a cone-bottom taper, or a horizontal orientation, use the Tank Volume Calculator instead — it shares this same core formula as one of its eight shapes.
What if I know a target volume and a diameter, and need the height?
Switch "Solve for" to Height, enter your diameter and target volume, and the required height calculates instantly. This is the common "how tall does this tube need to be" question when you’re sizing custom tubing, cores, or containers to hold a specific capacity.
Can I use this to size round bar or pipe stock?
Yes — the same π r² h relationship gives the volume of any solid cylindrical shape, so it works equally well for estimating material volume in round bar stock, shafts, or solid rod as it does for tank or tube capacity. For a hollow pipe's wall-material volume specifically, subtract the bore's volume (same formula, using the inside diameter) from the outside volume — run the calculator twice, once per diameter, and subtract the two results. See the wall-thickness section above for a worked example with the numbers filled in.
How exact are the unit conversions this calculator uses?
Exact, not approximate — the length and volume conversions are SI/NIST-defined constants (1 in = 25.4 mm, 1 US gallon = 231 in³), not rounded decimal approximations, so switching units never introduces its own rounding error on top of whatever precision you've selected. The one place real-world imprecision enters is your own input values, not the conversion math behind them.
Why does a horizontal tank at 25% liquid height hold less than 25% of its volume?
Because the cross-section a horizontal cylinder presents to a rising liquid level isn't a rectangle, it's a circle, and a circular segment's area doesn't grow in a straight line as height increases — it grows slowly near the bottom (where the circle is narrow), fastest through the middle, then slowly again near the top. A quarter-height fill in a horizontal cylinder works out to about 19.5% of capacity, not 25%. A vertical cylinder doesn't have this problem — see the partial-fill section above for the full comparison.
How do I find a pipe's wall-material volume, not just its bore capacity?
Run this calculator twice with the same height and different diameters — once with the outside diameter for the full solid envelope, once with the inside diameter for the bore — and subtract the second result from the first. The wall-thickness section above walks through a full worked example with a 100 mm OD, 5 mm wall pipe segment.