How to use the volume calculator
- Pick a shape from the list. Only that shape’s dimensions are shown.
- Enter each dimension. They must all be in the same unit.
- Choose the length unit so the answer is labeled in cubic units. With a unit chosen, the calculator also shows the volume in liters, US gallons and cubic meters.
The result updates as you type, with the formula and your numbers substituted in. That makes it easy to check the result or copy it into homework.
Volume formulas
| Shape | Formula | Inputs |
|---|---|---|
| Sphere | V = 4⁄3 πr³ | radius r |
| Cone | V = 1⁄3 πr²h | base radius r, height h |
| Cube | V = a³ | edge a |
| Cylinder | V = πr²h | radius r, height h |
| Rectangular prism | V = l × w × h | length, width, height |
| Capsule | V = πr²h + 4⁄3 πr³ | radius r, length h of the straight part |
| Spherical cap | V = 1⁄3 πh²(3R − h) | sphere radius R, cap height h |
| Conical frustum | V = 1⁄3 πh(r² + rR + R²) | top radius r, bottom radius R, height h |
| Ellipsoid | V = 4⁄3 πabc | semi-axes a, b, c |
| Square pyramid | V = 1⁄3 a²h | base edge a, height h |
| Tube | V = π(D² − d²)l ⁄ 4 | outer diameter D, inner diameter d, length l |
Worked example: a sphere of radius 5 cm
This is the example loaded when the page opens.
- Cube the radius: 5³ = 125.
- Multiply by 4⁄3 π: 4⁄3 × 3.14159265 × 125 = 523.5987756.
- Volume: ≈ 523.6 cm³.
- Convert: 523.6 cm³ ÷ 1,000 = 0.5236 L, and 0.5236 L ÷ 3.785411784 ≈ 0.1383 US gallons.
A ball 10 cm across therefore holds a little over half a liter.
Second example: a pipe. A tube with outer diameter 10, inner diameter 8 and length 20 has a wall volume of π × (100 − 64) × 20 ÷ 4 = 180π ≈ 565.49 cubic units. Multiply by the material’s density to get the pipe’s weight.
Practical tips
- Diameter or radius? Most formulas here use the radius, which is half the diameter. The tube is the exception, because pipes are sold by diameter.
- Tanks and containers. For a cylindrical tank lying on its side, the full volume is still πr²h. A partly filled horizontal tank needs a segment calculation.
- Spherical cap. A cap height of 2R is the whole sphere, and a cap height of R is a hemisphere. Use this shape for domes, bowls and lens shapes.
- Percent full. To find what share of a container is filled, divide the liquid volume by the full volume. The percentage calculator does this for you.
Limitations
- The formulas assume ideal geometric solids. Real objects have rounded edges, wall thickness and manufacturing tolerances.
- Unit conversions use exact definitions: 1 in = 2.54 cm, 1 L = 1,000 cm³ and 1 US gallon = 231 in³. Imperial (UK) gallons are larger, at about 4.546 L.
- Results are rounded to 10 significant figures. Very large or very small results switch to scientific notation.
Frequently asked questions
How do I convert cubic centimeters to liters?
Divide by 1,000. A liter is exactly 1,000 cm³, so 523.6 cm³ is 0.5236 L. One cubic meter holds 1,000 liters.
How many gallons are in a cubic foot?
About 7.48 US gallons. A US gallon is defined as exactly 231 cubic inches, and a cubic foot is 1,728 cubic inches, so 1,728 ÷ 231 ≈ 7.4805.
What is the difference between a cone and a frustum?
A frustum is a cone with its tip cut off parallel to the base, like a bucket or a lampshade. If the top radius is zero, the frustum formula reduces to the cone formula.
Why is a cone exactly one third of a cylinder?
A cone with the same base and height as a cylinder holds one third as much. You can show this with calculus, or by filling a cylinder with three cones of water. The same one-third rule links a pyramid to a prism.
Last reviewed: