How to Calculate Volume for Any Shape
By ToolNimba Editorial Team June 20, 2026 6 min read
Quick answer
To calculate volume you pick the formula that matches the shape. The three most common are: box (rectangular prism) = length x width x height, cylinder = pi x r squared x h, and sphere = 4/3 x pi x r cubed. Volume is always measured in cubic units such as cubic centimetres or cubic inches.
Volume tells you how much space is inside a 3D object, or how much it can hold. You need it to fill a fish tank, pour concrete, ship a box, mix a recipe or finish a geometry assignment. The catch is that there is no single volume formula. The right one depends on the shape. This guide gives you the volume formula for every common solid, shows where each one comes from, and walks through worked examples so the numbers actually make sense.
What volume actually means
Volume is the amount of three dimensional space an object occupies, measured in cubic units. Imagine filling a shape with tiny 1 by 1 by 1 cubes and counting how many fit inside. That count is the volume. Because you are stacking in three directions at once, volume always uses cubed units: cubic centimetres, cubic inches, cubic metres, or familiar capacity units like litres and gallons.
This is the key difference from area, which is flat and uses square units, and from surface area, which measures only the outer skin of a solid. Volume is about the inside. If your answer comes out in square units, you measured area by mistake. A correct volume answer is always cubic.
The main volume formulas
Here are the formulas for the solids you meet most often. In each one, r is the radius, l is length, w is width, h is height, and pi is about 3.14159. These cover almost every textbook problem and most real projects.
Volume formulas for common 3D shapes
| Shape | Volume formula | What the letters mean |
|---|---|---|
| Box (rectangular prism) | l x w x h | length times width times height |
| Cube | s cubed | s is the length of one edge |
| Cylinder | pi x r squared x h | r is radius, h is height |
| Sphere | 4/3 x pi x r cubed | r is the radius |
| Cone | 1/3 x pi x r squared x h | r is base radius, h is height |
| Square pyramid | 1/3 x base area x h | base area times height, divided by 3 |
A useful pattern hides in this table. Any shape with straight, matching sides (a box, a cube, a cylinder) is just its base area multiplied by its height. Any shape that tapers to a point (a cone or a pyramid) is exactly one third of the matching straight shape. That is why the cone is one third of a cylinder and the pyramid is one third of a box of the same base and height.
Volume of a box and a cube
The box, or rectangular prism, is the friendliest shape to start with. Its volume is simply length x width x height. You are stacking layers of cubes: the base covers length times width, and the height tells you how many of those layers stack up.
Worked example: volume of a box
Find the volume of a box that is 5 cm long, 3 cm wide and 4 cm tall.
- Multiply length by width to get the base area: 5 cm x 3 cm equals 15 square cm.
- Multiply the base area by the height: 15 x 4.
- The volume is 60 cubic cm.
A cube is just a box where every edge is the same length, so its volume collapses to s cubed (side x side x side). A cube with 4 cm edges holds 4 x 4 x 4, which is 64 cubic cm. If you are working with rooms or storage and want the answer in cubic feet, our how to calculate cubic feet guide walks through the same idea in imperial units.
Volume of a cylinder
A cylinder is a circle that has been given height, like a can or a pipe. Its volume is the area of the circular base times the height. Since the area of a circle is pi x r squared, the cylinder volume is pi x r squared x h. In words: find the circle, then stack it up to the height of the cylinder.
Worked example: volume of a cylinder
- Take a cylinder with radius 3 cm and height 10 cm.
- Find the base area: pi x r squared equals 3.14159 x 9, about 28.27 square cm.
- Multiply by the height: 28.27 x 10, which is about 282.7 cubic cm.
The most common slip here is using the diameter instead of the radius. The radius is half the diameter, so a pipe that is 6 cm across has a radius of 3 cm, not 6. For a deeper walkthrough with more examples, see our dedicated volume of a cylinder guide.
Volume of a sphere, cone and pyramid
A sphere is a perfectly round ball, and its volume is 4/3 x pi x r cubed. Notice the radius is cubed, not squared, because volume is three dimensional. For a ball of radius 3 cm, that is 4/3 x 3.14159 x 27, which works out to about 113 cubic cm. Doubling the radius makes a sphere eight times bigger, which surprises a lot of people.
A cone is like a cylinder that narrows to a point, and it holds exactly one third of the matching cylinder: 1/3 x pi x r squared x h. A pyramid follows the same rule against a box, giving 1/3 x base area x h. That one third factor is the single most forgotten part of these formulas, so write it down first whenever a shape comes to a point.
Common mistakes to avoid
Volume problems go wrong in a few predictable ways. Check these before you trust your answer.
- Giving the answer in square units. Volume is always cubic. If your units are squared, you stopped at area and forgot to multiply by the third dimension.
- Using diameter instead of radius. The radius is half the diameter. Plugging in the full width roughly multiplies a round shape's volume by four or eight.
- Forgetting the one third for cones and pyramids. A cone holds a third of its cylinder, not the whole thing. Skipping the 1/3 triples the answer.
- Mixing units. Convert every measurement to the same unit before multiplying, or the cubic result will be wrong.
- Cubing or squaring the wrong term. Sphere uses r cubed, cylinder and cone use r squared. Mixing these up is a frequent error.
Good to know: where volume shows up
Volume is everywhere once you start looking. You use it to fill a swimming pool or aquarium, to order the right amount of concrete or mulch, to price shipping by the size of a box, and to scale a recipe up or down. Engineers size fuel tanks with it, doctors dose medicine by volume, and shipping companies charge by it. Capacity units like litres and gallons are simply volume measured in friendlier amounts, which is why our volume converter can turn cubic centimetres straight into millilitres or cups.
If these ideas click, a couple of close relatives are worth a look. The area of a circle is the base of every cylinder and cone calculation, and the surface area formula measures the outside skin of the very same solids instead of the space inside.
Calculate volume instantly
Rather than juggle pi and exponents by hand, enter your measurements below and let the calculator pick the right formula and do the arithmetic. It supports boxes, cylinders, spheres, cones and more, and reports the answer in clear cubic units.
๐ฆ Try the free tool Volume Calculator Free volume calculator for 3D shapes. Find the volume of a cube, box, sphere, cylinder, cone, or pyramid by entering the dimensions. See the exact formula used.Once you see volume as base area stacked into height, with a one third discount for anything that tapers to a point, the formulas stop being a list to memorise and start to feel obvious. Match the shape, plug in the radius or sides, keep your units consistent, and your answer will always come out in cubic units.
Frequently asked questions
How do you calculate volume?
Choose the formula that matches the shape, then plug in your measurements. A box is length x width x height, a cylinder is pi x r squared x h, and a sphere is 4/3 x pi x r cubed. Keep every measurement in the same unit, and the answer will be in cubic units such as cubic centimetres.
What is the formula for the volume of a box?
The volume of a box, also called a rectangular prism, is length x width x height. Multiply the three dimensions together. For a box that is 5 by 3 by 4 cm, the volume is 5 x 3 x 4, which equals 60 cubic cm. A cube is the special case where all three sides are equal.
How do you find the volume of a cylinder?
Find the area of the circular base with pi x r squared, then multiply by the height. The full formula is pi x r squared x h. For a cylinder with radius 3 cm and height 10 cm, that is 3.14159 x 9 x 10, or about 282.7 cubic cm. Use the radius, not the diameter.
What is the volume of a sphere?
The volume of a sphere is 4/3 x pi x r cubed, where r is the radius. The radius is cubed because volume is three dimensional. For a sphere of radius 3 cm, the volume is 4/3 x 3.14159 x 27, which is about 113 cubic cm. Doubling the radius makes the sphere eight times larger.
Why is volume measured in cubic units?
Volume measures three dimensional space, so it multiplies length by width by height, three measurements with the same unit. That gives cubic units like cubic inches or cubic metres. Capacity units such as litres and gallons are just volume expressed in everyday amounts rather than raw cubes.
What is the difference between volume and surface area?
Volume is the space inside a solid, measured in cubic units, and tells you how much it can hold. Surface area is the total area of the outer skin, measured in square units, and tells you how much wrapping or paint it needs. One is the inside, the other is the outside.