Volume calculator
Cubic metres, litres, cubic feet, cubic yards and gallons of a box, cylinder, trench, cone or sphere. Add pieces and take away voids.
Pieces
Feet and inches work as you write them: 12' 6" or 12' 6 1/2".
Add this calculator to your website
Free for any website: paste this code where the calculator should appear. It keeps itself up to date, fits its height to the content and links back to the full page with the explanations.
How to use it
- 01Pick the shape: a box for a slab, footing or pit, a cylinder for a post hole or tank, a trench when the sides slope.
- 02Type the sizes. Feet and inches can be typed as written: 3' 6". Depth in inches works too: choose in.
- 03For a pipe or an old footing inside the volume, add a void: it is taken away.
- 04Read the total in cubic yards and cubic feet, and the same volume in gallons, litres or cubic metres.
How it is calculated
Every piece is worked out with its own formula, voids are subtracted, and the total is converted with exact factors.
- Box
- V = length × width × height
- Cylinder
- V = π d² / 4 × h
- Trench with sloped sides
- V = length × (bottom + top) / 2 × depth
- Cone and pyramid
- V = π d² / 12 × h; pyramid L × W × h / 3
- Truncated cone
- V = π h / 12 × (D² + D d + d²)
- Sphere
- V = π d³ / 6
NIST Handbook 44 gives 1 yd³ = 27 ft³ and the US gallon as 231 in³ exactly. With the foot at 0.3048 m, 1 yd³ = 0.764555 m³ and 1 gallon = 3.785 litres.
This is the solid volume. Loose material such as gravel or soil takes more room before it is compacted, and concrete needs some extra for spills and uneven ground. The concrete and gravel calculators on this site add that.
Worked example
A 3 × 3 ft pit, 36 in deep
- 36 in = 3 ft.
- Volume: 3 × 3 × 3 = 27 ft³.
- In cubic yards: 27 / 27 = 1 yd³.
- In gallons: 27 × 1728 / 231 = 202 gal.
- In cubic metres: 0.765 m³.
Getting the order right
Measure depth in several places
Ground is rarely flat. Take the depth at the corners and in the middle and use the average.
Split odd shapes
A ramp is half a box; a footing with a step is two boxes. Add the pieces.
Cubic yards for ordering
Ready-mix concrete, gravel and topsoil in the US are sold by the cubic yard. Round up to what the supplier delivers.
Common mistakes
- Mixing inches and feet: 4 in deep is 0.333 ft, not 0.4 ft.
- Using the radius in a formula that asks for the diameter.
- Forgetting that a cone holds a third of its cylinder.
- Ordering the exact solid volume of loose material.
Questions
How many cubic feet in a cubic yard?
27. A cubic yard is 3 × 3 × 3 ft.
How do I calculate cubic yards?
Multiply length, width and depth in feet, then divide by 27. A 10 × 10 ft area 4 in deep is 10 × 10 × 0.333 / 27 = 1.23 yd³.
How many gallons in a cubic foot?
1728 / 231 = 7.48 US gallons.
How do I get tons from cubic yards?
Multiply by the bulk density of the material. The gravel calculator on this site does it with values from data sheets.
Guides on this topic
- How to calculate cubic yards and cubic metres
Calculate volume in cubic yards, feet and metres, convert ft³ to yd³, and turn cubic feet or metres into gallons and litres for tanks and ponds.
Related calculators
Sources
- [1]Handbook 44, Appendix C: General Tables of Units of Measurement. National Institute of Standards and Technology (NIST). U.S. gallon = 231 in³ exactly (3.785 l); 27 ft³ = 1 yd³ (0.765 m³); the litre is the cubic decimetre.. Checked November 5, 2026
- [2]U.S. Survey Foot: Revised Unit Conversion Factors. National Institute of Standards and Technology (NIST). International foot 0.3048 m exactly; survey-foot definitions not used after 2022.. Checked November 5, 2026
Formulas and sources last checked on November 5, 2026. How we calculate