How to use it
- Pick a shape, choose the unit you measured in, and type the dimensions. Fractions (3/4), mixed numbers (2 1/2) and decimals all work.
- The volume appears exactly, with π kept as π for round shapes (a cylinder of radius 3 and height 5 is 45π cubic units), and as a decimal.
- The table converts it to cubic centimeters, cubic meters, liters, milliliters, cubic inches, feet and yards, US gallons, quarts, cups and fluid ounces, and imperial gallons.
The formulas
| Shape | Volume |
|---|---|
| Cube | a³ |
| Rectangular prism (box) | l × w × h |
| Cylinder | πr²h |
| Cone | ⅓πr²h |
| Sphere | ⁴⁄₃πr³ |
| Hemisphere | ⅔πr³ |
| Pyramid (rectangular base) | ⅓ × base area × height = ⅓lwh |
| Triangular prism | ½ × base × triangle height × length |
| Capsule | πr²h + ⁴⁄₃πr³ (a cylinder with a hemisphere on each end) |
| Ellipsoid | ⁴⁄₃πabc (semi-axes a, b, c) |
| Conical frustum | ⅓πh(R² + Rr + r²) |
| Tube (pipe) | π(R² − r²)h |
A cone holds exactly a third of the cylinder with the same base and height, and a pyramid a third of the matching box, which is where the ⅓ comes from. Radius is half the diameter: a can 8 cm across has r = 4 cm.
Converting to liters and gallons
Every conversion goes through exact definitions rather than rounded factors: an inch is exactly 2.54 cm (so a foot is 0.3048 m), a liter is exactly one cubic decimeter (1,000 cm³), a US gallon is exactly 231 cubic inches, which makes it 3.785411784 liters, and an imperial gallon is exactly 4.54609 liters, about 20% more than a US gallon. A cubic foot is 28.316846592 liters, or about 7.48 US gallons, the number to use for a pool, a tank or a raised bed measured in feet. US cups and fluid ounces here are the gallon-based customary units (16 cups or 128 fluid ounces to the gallon).
What we tested
On October 15, 2026 we ran the page’s own functions on 2,400 random solids, about 200 of each shape, with whole-number, decimal and fractional dimensions in all six length units, and compared them with the SymPy computer-algebra library: all 2,303 volumes matched SymPy exactly (including the factor of π), the 97 tubes with an inner radius at least as large as the outer one were refused, and all 29,939 unit conversions matched the exact definitions above. In Chromium: the default cylinder (r 3, h 5 cm) showed 45π cm³ ≈ 141.37 cm³ and 0.141 liters; all 12 shapes drew a picture and a volume; a 1 ft cube converted to 1,728 in³, 28.316847 liters and 7.4805195 US gallons; a sphere of radius 1 1/2 in gave (9/2)π in³; a tube with the inner radius larger than the outer showed a message; the page survived a reload and fitted a 390 px phone with no errors. We also checked the check: defining the US gallon as 230 cubic inches instead of 231 made every case fail.
Sources
Checked on .
- NIST Special Publication 811: Guide for the Use of the International System of Units
- NIST Office of Weights and Measures: Unit Conversion
- UK Weights and Measures Act 1985, Schedule 1 (definition of the gallon as 4.54609 cubic decimetres)
- OpenStax: Prealgebra 2e, section 9.6 Solve Geometry Applications: Volume and Surface Area
Frequently Asked Questions
Built by Derek Giordano · Part of Ultimate Design Tools