Volume calculator
Pick a shape and enter its measurements. Get the volume of a cylinder, rectangular box, cube, cone, sphere, pyramid or prism, how much a pipe holds, or how much liquid is in a vertical, horizontal or rectangular tank. The formula is worked out with your numbers, and the answer is shown in cubic units, liters and gallons.
Answers update as you type. Works in millimeters to yards
Use the inside measurements. Cylindrical tanks are taken to have flat ends; rounded ends hold a little more.
Use the same unit for every measurement.
- Volume
- –
V = π × r² × h
Enter each measurement to see the volume.
In other units
- –
How to find volume
Volume is the space a solid takes up, measured in cubic units such as cubic inches (in³) or cubic centimeters (cm³). For a box, multiply length × width × height. For any shape with the same cross-section all the way through, such as a cylinder or a prism, multiply the area of the end by the length. A cone or pyramid holds exactly a third of the cylinder or box it fits in.
Use one unit for every measurement, and the volume comes out in that unit cubed. The calculator then converts it: 1 cubic foot is 7.48 US gallons, 1 liter is 1,000 cm³, and 1 cubic meter is 1,000 liters.
For worked examples of each formula, read how to find volume and area.
Volume formulas
The formula for each shape the calculator covers.
| Shape | Formula | What the letters mean |
|---|---|---|
| Cylinder | V = π × r² × h | r is the radius (half the diameter) and h the height. |
| Rectangular box | V = l × w × h | Length, width and height. A cube is the same with all three equal: V = a³. |
| Cone | V = π × r² × h ÷ 3 | A third of a cylinder with the same base and height. |
| Sphere | V = 4 ÷ 3 × π × r³ | r is the radius. A hemisphere is half: V = 2 ÷ 3 × π × r³. |
| Pyramid | V = l × w × h ÷ 3 | The base is l by w, and h is the height from the base straight up to the tip. |
| Triangular prism | V = b × h ÷ 2 × l | The triangle’s base and height, times the length of the prism. |
| Pipe | V = π × (d ÷ 2)² × l | d is the inside diameter and l the length. |
Volume of a rectangle
A rectangle is flat, so it has an area but no volume. When people ask for the volume of a rectangle they mean a rectangular box, also called a rectangular prism or cuboid: multiply length × width × height. A room 12 ft long, 10 ft wide and 8 ft high holds 12 × 10 × 8 = 960 cubic feet, or about 35.6 cubic yards.
Volume of a cylinder
Multiply the area of the circular end, π × r², by the height. A can 6 cm across and 10 cm tall has a radius of 3 cm, so its volume is π × 3² × 10 = 282.74 cm³, or about 283 milliliters. If you measured across the circle, choose Diameter and the calculator halves it for you.
Tank volume and how much is in it
A vertical cylindrical tank holds π × (d ÷ 2)² × h. A tank 4 ft across and 6 ft tall holds 75.4 cubic feet, or about 564 US gallons. Enter the liquid depth to see how much is in it now: in a vertical or rectangular tank, the amount grows evenly with the depth.
A horizontal tank doesn’t fill evenly, because it’s narrow at the bottom and the top and widest in the middle. At a quarter of the depth it’s only 19.6% full, and at half the depth it’s 50% full. The calculator works out the liquid as a circular segment times the length, so the answer is exact for a cylinder with flat ends. Tanks with rounded ends hold a little more.
Pipe volume
The water a pipe holds is π × (d ÷ 2)² × l, using the inside diameter. A pipe’s nominal size is a name, not a measurement: a 2-inch Schedule 40 steel pipe is 2.375 in on the outside and 2.067 in on the inside, so 10 ft of it holds about 1.74 US gallons, not the 1.63 a true 2-inch bore would. Check the inside diameter in a pipe dimension table or measure it. Add the outside diameter to see the volume of the pipe wall itself.
For the area of a flat shape or the surface area of a solid, use the area calculator.
Conversion factors from NIST’s Guide to the SI, Appendix B: the inch is exactly 2.54 cm and the US gallon 231 cubic inches.
Questions about volume
How do you find the volume of a rectangle?
Multiply the length, the width and the height: V = l × w × h. A box 4 in long, 3 in wide and 2 in high holds 4 × 3 × 2 = 24 cubic inches. Strictly, that’s a rectangular box (a rectangular prism), because a flat rectangle has no volume.
How many gallons are in a cubic foot?
A cubic foot holds 7.48 US gallons, or 28.3 liters. To turn cubic feet into US gallons, multiply by 7.48; to turn cubic inches into gallons, divide by 231. The imperial gallon used in the UK is bigger, so a cubic foot is 6.23 imperial gallons.
How do I work out a cylinder’s volume in gallons?
Choose Cylinder and the inch or foot unit, enter the radius or diameter and the height, and read the US gallons under In other units. By hand: work out π × r² × h in cubic inches and divide by 231. A bucket 12 in across and 14 in deep holds π × 6² × 14 = 1,583 cubic inches, about 6.9 gallons.
How do I find how much liquid is in a partly full tank?
Choose Tank and its shape, enter its size, then enter how deep the liquid is, measured from the bottom. The readout shows the liquid, and the lines under it show the full tank and how full it is. For a horizontal tank, don’t simply scale by the depth: a quarter of the depth is less than a fifth of the volume.
What’s the difference between volume and capacity?
Volume is the space an object takes up, and capacity is how much it can hold. For a thin-walled tank they’re almost the same, but for a thick pipe or a mug the inside is smaller than the outside. Measure on the inside for capacity, which is why the pipe asks for the inside diameter.
What’s the volume of a cone compared with a cylinder?
A cone holds exactly a third of a cylinder with the same base and height, so its formula is π × r² × h ÷ 3. A pyramid is a third of the box it fits in in the same way, and a sphere is two thirds of the cylinder it just fits inside.