How the volume calculator works
Volume measures the space a solid occupies. Its units are cubic: a cube measuring 1 inch along each edge has a volume of 1 cubic inch, written in3. The shape determines which dimensions you need and which formula applies.
Choose Box, Cylinder, Sphere or Cone, or open More shapes to browse or search the other 12 options. Enter the dimensions shown on the drawing and select your measurement unit. For circular measurements, check whether you are entering a radius or diameter. The result shows the volume, its formula and working, an exact form where applicable, and conversions to cubic units, liters and gallons.
Volume formulas and required measurements
A prism's volume is its base area multiplied by its perpendicular height. The same rule applies to a cylinder. A pyramid or cone has one-third the volume of a prism or cylinder with the same base area and height.
Use corresponding units, such as square centimeters for base area and centimeters for height, to obtain cubic centimeters.
| Shape | Measurements | Volume V |
|---|---|---|
| Rectangular box | Length l, width w, height h | l × w × h |
| Cube | Edge a | a3 |
| Cylinder | Radius r, height h | πr2h |
| Sphere | Radius r | (4/3)πr3 |
| Cone | Base radius r, height h | (1/3)πr2h |
| Hemisphere | Radius r | (2/3)πr3 |
| Pyramid (rectangular base) | Base length l, base width w, height h | (1/3)lwh |
| Triangular prism | Triangle base b, triangle height t, prism length l | (1/2)btl |
| Capsule | Radius r, cylindrical section length a | πr2a + (4/3)πr3 |
| Ellipsoid | Semiaxes a, b and c | (4/3)πabc |
| Conical frustum | End radii R and r, height h | (1/3)πh(R2 + Rr + r2) |
| Square frustum | Parallel square end sides a and b, height h | (1/3)h(a2 + ab + b2) |
| Spherical cap | Whole sphere radius R, cap height h | (1/3)πh2(3R − h) |
| Torus | Major radius R, tube radius r | 2π2Rr2 |
| Tube | Outer radius R, inner radius r, length h | π(R2 − r2)h |
| Regular hexagonal prism | Hexagon side a, prism height h | (3√3/2)a2h |
Some dimensions need particular care. A capsule consists of a cylinder with two hemispherical ends, so its cylindrical section length excludes both rounded ends. Subtract twice the radius from its overall length to find that section. An ellipsoid's semiaxes are measured from its center to its surface along its three principal axes; they are half the full axis lengths.
Worked example: volume of a cylinder
Choose Cylinder and enter a radius of 3 inches and a height of 10 inches. First square the radius: 32 = 9. Multiply by the height to get 90, then multiply by π. The exact volume is 90π in3, which rounds to 282.74 in3.
Converting the unrounded volume gives 4.63 liters or 1.22 US gallons. For the gallon conversion, divide 90π by 231 because one US liquid gallon equals exactly 231 cubic inches. The exact form retains π; the decimal result and converted values are rounded approximations.
Converting cubic units, liters and gallons
Volume conversions use the cube of the length conversion. Since 1 foot equals 12 inches, 1 cubic foot equals 12 × 12 × 12 = 1,728 cubic inches. Multiplying by 12 alone would convert only one of the three dimensions.
| Volume | Equivalent volume |
|---|---|
| 1 cm³ | = 1 mL |
| 1 L | = 1,000 cm³ ≈ 61.02 in³ |
| 1 ft³ | = 1,728 in³ ≈ 28.32 L ≈ 7.48 US gal |
| 1 yd³ | = 27 ft³ ≈ 0.765 m³ |
| 1 m³ | = 1,000 L ≈ 35.31 ft³ |
| 1 US gal | = 231 in³ ≈ 3.785 L |
| 1 imperial gal | ≈ 4.546 L |
Tips for measuring your shape
- 1Measure the appropriate boundary. Use internal dimensions to find a container's capacity and external dimensions to find the space its outside shape occupies. For a thick-walled container, those are different volumes.
- 2Use perpendicular height. For a cone, pyramid or frustum, measure height at a right angle to the base, not along a sloping edge. For a triangular prism, distinguish the triangle's height from the prism's length.
- 3Keep intermediate values unrounded. Use the full calculated volume when converting units, then round the final answer. Extra displayed decimal places do not make the original measurements more precise.
Volume calculator FAQ
What if I have the diameter instead of the radius?
Choose Diameter where that option is available, or divide the diameter by 2 before entering a radius. The distinction changes the result substantially: using a diameter as a radius makes a cylinder's calculated volume four times too large and a sphere's eight times too large. Those factors follow from the squared and cubed radius terms.
Can I use feet and inches in the same calculation?
Convert the measurements to a common unit before substituting them into a formula. For example, 2 ft 6 in is 2.5 ft or 30 in. Multiplying a length in feet by unconverted measurements in inches does not give a result in cubic feet or cubic inches alone.
What is the volume formula for a sphere?
A sphere's volume is (4/3)πr3, where r is its radius. With a radius of 3 inches, the calculated volume is 36π, or about 113.10 cubic inches. A hemisphere with the same radius has half that volume.
How many gallons are in a cubic foot?
One cubic foot contains about 7.48 US liquid gallons, calculated as 1,728 ÷ 231. An imperial gallon is larger than a US gallon, so the number of imperial gallons in the same volume is smaller. Check which gallon the result labels before using it.
Does the tube formula give pipe material or liquid capacity?
The tube formula gives the material between the inner and outer cylindrical surfaces: outer cylinder volume minus inner cylinder volume. To find the liquid capacity of the hollow space, choose Cylinder and use the inner radius and internal length.
How can I estimate the volume of an irregular object?
As a geometric approximation, divide it into nonoverlapping parts that resemble the listed shapes and calculate each part separately. Add solid sections and subtract holes or cutouts. The result depends on how closely those ideal shapes match the object.
Sources
- 19.6 Solve Geometry Applications: Volume and Surface Area · OpenStax, Rice University · Accessed November 2026
- 2Volume · Wolfram Research · Accessed November 2026
- 3Ellipsoid · Wolfram Research · Accessed November 2026
- 4Spherical Cap · Wolfram Research · Accessed November 2026
- 5Torus · Wolfram Research · Accessed November 2026
- 6Regular Hexagon · Wolfram Research · Accessed November 2026
- 7Handbook 44 (2026), Appendix C: General Tables of Units of Measurement · National Institute of Standards and Technology · Accessed November 2026