What this calculator does
This tool calculates the volume of eleven common three-dimensional geometric solids: capsule, cone, conical frustum, cube, cylinder, hemisphere, square pyramid, rectangular prism, sphere, spherical cap and triangular prism. Choose a shape, pick a length unit, enter the relevant dimensions, and the calculator returns the total volume \(V\) in that unit cubed (for example cm³ or ft³).
How to use it
First select the solid from the "Calculate the Volume of" dropdown. Then choose your unit of length (all linear dimensions must use the same unit). Fill in only the fields your shape needs — for a cylinder you need radius \(r\) and height \(h\), for a cube only the side length \(a\), for a sphere only the radius \(r\). Because every dimension shares one unit, the volume comes out directly in that unit raised to the third power.
The formulas
Each solid uses a standard geometry formula. A few key ones: sphere \(V = \tfrac{4}{3}\pi r^3\); cone \(V = \tfrac{1}{3}\pi r^2 h\); cylinder \(V = \pi r^2 h\); cube \(V = a^3\); rectangular prism \(V = l\cdot w\cdot h\); square pyramid \(V = \tfrac{1}{3}a^2 h\); capsule \(V = \pi r^2 a + \tfrac{4}{3}\pi r^3\); conical frustum \(V = \tfrac{1}{3}\pi h(r^2 + rR + R^2)\); spherical cap \(V = \tfrac{1}{6}\pi h(3a^2 + h^2)\); triangular prism \(V = \tfrac{1}{2}\cdot \text{base}\cdot \text{triangleHeight}\cdot \text{prismLength}\). The constant \(\pi\) is taken as Math.PI.
Worked example
Take the default square pyramid with base side \(a = 4\) in and height \(h = 3\) in.
$$V = \tfrac{1}{3} \times a^2 \times h = \tfrac{1}{3} \times 16 \times 3 = 16 \text{ in}^3$$As a second example, a cylinder with radius \(r = 5\) cm and height \(h = 10\) cm gives
$$V = \pi \times 25 \times 10 = 785.398 \text{ cm}^3$$FAQ
Does the unit affect the formula? No. Volume scales by the cube of the unit factor, so as long as every dimension uses the same unit, the answer is simply in that unit cubed.
What is a conical frustum? It is a cone with the tip sliced off parallel to the base, leaving a smaller top radius \(r\) and a larger bottom radius \(R\).
Why must dimensions be positive? A solid with a zero or negative length has no meaningful physical volume, so all dimensions should be greater than zero.