Calculate the volume of common 3D shapes: sphere, cube, cylinder, cone, box, pyramid, and more.
| Shape | Formula |
|---|---|
| Sphere | V = (4/3)πr³ |
| Cube | V = a³ |
| Rectangular Box | V = l × w × h |
| Cylinder | V = πr²h |
| Cone | V = (1/3)πr²h |
| Capsule | V = πr²(h + 4r/3) |
| Spherical Cap | V = (πh²/3)(3r − h) |
| Conical Frustum | V = (πh/3)(R² + Rr + r²) |
| Ellipsoid | V = (4/3)πabc |
| Square Pyramid | V = (1/3)a²h |
| Tube / Pipe | V = π(R² − r²)h |
Dev has a round planter 40 cm across and 35 cm deep, plus two 25-litre bags of potting soil in the garage. Will two bags fill it, or is another trip to the garden centre coming? This calculator answers that kind of question for eleven shapes: sphere, cube, rectangular box, cylinder, cone, capsule, spherical cap, conical frustum, ellipsoid, square pyramid and tube.
Start with what you actually measured. The planter is 40 cm across, so the radius is half of that, r = 20 cm. The depth is h = 35 cm.
Square the radius: 20 × 20 = 400. Multiplying by the depth gives 400 × 35 = 14,000, which is the volume of a block with that base area before the circle factor is applied.
The cylinder formula is V = πr²h. Every shape on the page has its own version, such as (4/3)πr³ for a sphere, (1/3)πr²h for a cone and l × w × h for a box, and the one in use is printed under the input boxes.
Now multiply by π: π × 400 × 35 = 43,982.29715 cubic centimetres. The page shows up to ten significant digits, and a very large or very small result switches to scientific notation, so a tiny sphere of radius 0.00001 reads 4.18879e-15 instead of a misleading 0.
Convert to something you can buy. 1,000 cm³ is one litre, so the planter holds about 44 litres. Two 25-litre bags supply 50, which leaves roughly 6 litres for the soil to settle. Had 40 been typed as the radius by mistake, the page would report 175,929.1886 cm³, exactly four times too much.
Two shape notes. The conical frustum is symmetric in its two radii, so it does not matter which one you call top or bottom, and equal radii are fine: R = r = 10 with h = 30 gives 9,424.777961, which is exactly the cylinder volume. The capsule is a cylinder of height h with a hemisphere of radius r on each end, and the square pyramid takes h as the vertical height from base to apex.
No, that is the diameter, so halve it before typing. The slip is expensive because radius gets squared or cubed. Entering 40 instead of 20 in the planter example quadruples a cylinder's volume, and for a sphere the error is eightfold.
Every field must contain a number above zero. An empty box produces a short prompt to fill in every field, and a zero or negative entry produces a red message naming the offending box, for example Radius (r) must be a number greater than 0. Absurdly large inputs, such as a radius of 1e200, are reported as too large to calculate rather than shown as a meaningless figure.
Not safely. All dimensions must share a unit and the answer is that unit cubed. Convert first, remembering that 1 cubic foot is 1,728 cubic inches, not 12. A US gallon is 231 cubic inches, and 1,000 cubic centimetres make a litre.
For the capsule, h is only the straight middle section between the two hemispheres. A capsule 30 cm long end to end with radius 5 has h = 20 and a volume of 2,094.395102. For the spherical cap, h is the height of the cap and cannot exceed 2r, or the page shows an error.
Yes. When R equals r the frustum is simply a cylinder, and the formula returns the cylinder volume, so the page accepts it. Which radius is larger makes no difference. R = 15, r = 10 and h = 30 give 14,922.5651. The tube has its own rule: the inner radius must be smaller than the outer one, otherwise the page shows an error.