calc-hub logocalc-hub.net
MathVolumeGeometryUnit ConversionCalculators

How to Calculate Volume of a Box, Cylinder, Cone, Sphere or Pyramid

T. Krause

A box is length × width × height and a cylinder is π × r² × h. The formulas for six shapes, worked examples, and how to turn cubic feet into gallons.

To calculate volume, measure the shape in one unit, put the measurements into the formula for that shape, and read the answer in that unit cubed. A box 4 feet long, 3 feet wide and 2 feet high holds 4 × 3 × 2 = 24 cubic feet. That is about 179.5 US gallons, or 679.6 liters.

Each shape has its own formula, and the arithmetic is short. Most wrong answers come from two slips: putting the diameter where the formula wants the radius, and converting cubic units with a factor meant for plain lengths. Both get their own section below.

How to Calculate Volume of a Box, Cylinder, Cone, Sphere or Pyramid

The formulas

ShapeVolumeWhat you measure
Cubes³one side, s
Box (rectangular prism)l × w × hlength, width and height
Cylinderπ × r² × hradius of the round end and the height
Cone⅓ × π × r² × hradius of the base and the height to the tip
Sphere4/3 × π × r³radius
Pyramid⅓ × l × w × hlength and width of the base and the height to the tip

The cone and the pyramid are each a third of the shape around them. A cone holds a third of the cylinder with the same base and height, and a pyramid with a rectangular base holds a third of the box with the same base and height.

Cube and box

Multiply the three edges. A cube with 10 cm sides holds 10 × 10 × 10 = 1,000 cm³, which is exactly 1 liter.

An aquarium 30 inches long, 18 inches deep and 12 inches high holds 30 × 18 × 12 = 6,480 cubic inches. A US gallon is defined as 231 cubic inches, so the tank holds 6,480 ÷ 231 = 28.05 gallons, or 106.19 liters. If the walls are thick, measure the inside, because the outside dimensions include the glass.

Cylinder

Square the radius, multiply by π, then multiply by the height. The radius is half the diameter, the distance straight across the round end.

A water tank 2 feet across and 3 feet tall has a radius of 1 foot:

  1. Square the radius: 1² = 1.
  2. Multiply by π: 1 × π = 3.1416.
  3. Multiply by the height: 3.1416 × 3 = 9.42 cubic feet.

That is about 70.5 US gallons. Put the diameter of 2 in place of the radius and you get π × 2² × 3 = 37.70 cubic feet, four times too much, because the formula squares whatever number you give it.

A straight-sided container 30 cm across and 40 cm deep works the same way. The radius is 15 cm, so the volume is π × 15² × 40 = 28,274 cm³. That is 28.27 liters, or about 7.47 US gallons.

Cone

A pile of gravel or mulch tipped off a truck has roughly the shape of a cone. Take a pile 8 feet across and 3 feet high. The radius is 4 feet:

  1. Square the radius: 4² = 16.
  2. Multiply by π and the height: 16 × π × 3 = 150.80.
  3. Divide by 3: 150.80 ÷ 3 = 50.27 cubic feet.

Landscape suppliers sell by the cubic yard, and a cubic yard is 27 cubic feet, so the pile is 50.27 ÷ 27 = 1.86 cubic yards.

The height in the formula runs straight up from the center of the base to the tip. A tape laid over the side of the pile measures the slant height, which is longer. If that's all you have, the radius, the height and the slant height form a right triangle, so the height is √(slant² − r²). A slant height of 5 feet and a radius of 4 feet give √(25 − 16) = √9 = 3 feet. The article on solving a triangle covers the other cases.

Sphere

Cube the radius, then multiply by π and by 4/3. A ball 24 cm across has a radius of 12 cm:

  1. Cube the radius: 12 × 12 × 12 = 1,728.
  2. Multiply by π: 1,728 × π = 5,428.67.
  3. Multiply by 4/3: 5,428.67 × 4 ÷ 3 = 7,238.23 cm³.

That is about 7.24 liters. A hemisphere, such as a round-bottomed bowl, holds half of that, 3,619 cm³.

Measuring across a ball is awkward, so wrap a tape around its widest part instead and divide by π. A circumference of 75.4 cm gives a diameter of 75.4 ÷ π = 24.0 cm.

A sphere holds two thirds of the cylinder that just fits around it. The cylinder around this ball has a radius of 12 cm and a height of 24 cm, so it holds π × 144 × 24 = 10,857 cm³, and two thirds of that is 7,238 cm³.

Pyramid

Multiply the base length, the base width and the height, then divide by 3. A pyramid on a 6 m by 6 m base, 4 m high, holds 6 × 6 × 4 ÷ 3 = 48 m³. The box with the same base and height would hold 144 m³.

As with the cone, use the vertical height from the base to the tip, not the length of a sloping face.

Converting cubic units

Units in a volume are cubed, and so is the conversion factor. A foot is 12 inches, so a cubic foot is 12 × 12 × 12 = 1,728 cubic inches. Dividing cubic inches by 12 gives a number 144 times too large.

FromToMultiply by
cubic inchesUS gallons1 ÷ 231, or 0.004329
cubic feetcubic inches1,728
cubic feetUS gallons7.4805
cubic feetliters28.317
cubic yardscubic feet27
cubic metersliters1,000
cubic metersUS gallons264.17
litersUS gallons0.26417
cubic centimetersmilliliters1

The 7.4805 comes from the two definitions above: 1,728 cubic inches in a cubic foot divided by 231 cubic inches in a gallon. The UK imperial gallon is larger, 4.54609 liters, so a cubic foot is about 6.23 imperial gallons.

When your measurements come in different units, convert them before you multiply. A slab 10 feet by 12 feet and 4 inches thick is 10 × 12 × (4 ÷ 12) = 40 cubic feet. Divide by 27 for 1.48 cubic yards. The article on concrete yardage for a slab pour adds the waste allowance you need when you order.

Doing it with the calculator

The volume calculator covers the six shapes in this article and the ellipsoid. Pick the shape, enter the dimensions it asks for in one unit and press the button. The result comes back in that unit cubed, labeled "units³" because the calculator doesn't know which unit you used.

It asks for the radius, so halve a diameter before you enter it. Enter a cylinder with a radius of 1 and a height of 3 and it returns 9.4248. A cone with a radius of 4 and a height of 3 returns 50.2655, and a sphere with a radius of 12 returns 7,238.2295.

The calculator doesn't convert units. To turn liters into US gallons, quarts or cups, use the conversion calculator. It has no cubic feet, so multiply cubic feet by 28.317 to get liters first, or by 7.4805 to go straight to US gallons. For material you buy by the cubic yard, use the concrete calculator, which also counts the bags, or the gravel calculator, which also gives the weight in tons.

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking "Accept", you agree to our use of cookies.
Learn more.