Pick a shape, enter its measurements in any unit, and get the volume with the formula worked out, plus the same volume in gallons, liters, cubic feet and cubic yards.
Volume formulas
| Shape | Volume |
| Cube (edge s) | s³ |
| Rectangular box | length × width × height |
| Cylinder | πr²h |
| Cone | ⅓πr²h |
| Sphere | ⁴⁄₃πr³ |
| Hemisphere | ⅔πr³ |
| Pyramid with a rectangular base | ⅓ × length × width × height |
| Triangular prism | ½ × triangle base × triangle height × prism length |
| Capsule (cylinder with round ends) | πr²a + ⁴⁄₃πr³, where a is the straight middle length |
| Frustum of a cone | ⅓πh(R² + Rr + r²) |
A cone holds exactly a third of the cylinder with the same base and height, and a pyramid a third of the matching box.
Worked example: a can of paint
A cylinder 6 inches across (radius 3 in) and 10 inches tall:
V = π × 3² × 10 = 90π ≈ 282.74 cubic inches
A US gallon is exactly 231 cubic inches, so that's 282.74 ÷ 231 ≈ 1.224 gallons, or 4.633 liters.
Unit conversions used
All conversions start from the exact definition 1 inch = 2.54 cm. One US gallon is 231 in³ (3.785411784 liters), one cubic foot is 1,728 in³ (about 7.48 gallons), and one cubic yard is 27 cubic feet.
When the result doesn't apply
- Use inside measurements to find how much a container holds. Outside measurements include the walls.
- These are ideal shapes. Real tanks with rounded corners, sloped bottoms or fittings hold a little less.
- Gallons here are US liquid gallons. A UK (imperial) gallon is about 20% bigger, at 4.54609 liters.
Sources
How we checked this
Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:
- Cylinder r = 3 in, h = 10 in: 90π ≈ 282.7433 in³ ✓
- 10 ft cube-shaped box: 1,000 ft³ ≈ 7,480.52 US gallons ✓
- Sphere r = 1 m ≈ 4,188.79 liters ✓
- Frustum R = 4, r = 2, h = 6 cm: 56π ≈ 175.929 cm³ ✓
- Capsule r = 2, middle 5: 20π + 32π/3 ≈ 96.3422 ✓
- A negative radius is rejected ✓
Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.
Questions people ask
How do I calculate volume in gallons?
Find the volume in cubic inches and divide by 231, or in cubic feet and multiply by about 7.48. The calculator does this for you in any unit.
How do I find the volume of a cylinder?
Multiply π by the radius squared and then by the height: V = πr²h. A cylinder with radius 3 and height 10 holds 90π ≈ 282.74 cubic units.
What's the difference between volume and capacity?
Volume is the space a shape takes up. Capacity is how much a container holds, which is the volume of its inside. For thin-walled containers they're almost the same.
How many liters are in a cubic foot?
About 28.317 liters. A cubic foot is 0.028316846592 cubic meters exactly, and a cubic meter is 1,000 liters.