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 rounds to six decimals and shows at most ten significant digits.
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.
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. If one is blank, zero or negative, the page shows nothing at all and gives no error message, so a missing value is easy to overlook.
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.
The top and bottom radii cannot be equal, because that shape is a cylinder and the page tells you to use that option instead. Which radius is larger makes no difference. R = 15, r = 10 and h = 30 give 14,922.56511. The tube has a similar rule: the inner radius must be smaller than the outer one.