How to Calculate Volume: Formulas for Boxes, Cylinders, Cones and Spheres

Most volume formulas are base area times height, with a factor of one-third for pointed shapes. Formulas, worked examples and unit conversions.

Volume measures how much space a three-dimensional shape occupies, in cubic units. For any shape with straight sides and a constant cross-section, volume = base area × height: a box is length × width × height, and a cylinder is πr² × height. Shapes that come to a point, cones and pyramids, hold one-third of that. A sphere is (4/3)πr³. A box 4 ft × 3 ft × 2 ft holds 24 ft³, about 179.5 gallons of water.

Volume formulas at a glance

Shape Formula Example Volume
Cube V = s³ s = 3 27
Rectangular box V = l × w × h 4 × 3 × 2 24
Triangular prism V = (½bh) × L b = 4, h = 3, L = 10 60
Cylinder V = πr²h r = 1.5, h = 4 28.27
Cone V = ⅓πr²h r = 3, h = 4 37.70
Square pyramid V = ⅓s²h s = 6, h = 9 108
Sphere V = (4/3)πr³ r = 5 523.60
Hemisphere V = (2/3)πr³ r = 5 261.80

The volume calculator covers all of these, and the 3D shape formulas page adds surface areas.

Prisms and cylinders: base × height

V = B × h

Here B is the area of the base and h is the perpendicular height. This single idea covers boxes, triangular prisms, hexagonal prisms and cylinders: find the area of the end face, then multiply by the length.

Example: a rectangular tank

A tank 4 ft long, 3 ft wide and 2 ft deep

V = 4 × 3 × 2 = 24 ft³

In gallons: 24 × 7.48052 ≈ 179.5 gal

Example: a cylindrical tank

Radius 1.5 ft, height 4 ft

V = π × 1.5² × 4 = π × 9 ≈ 28.27 ft³ ≈ 211.5 gal

Measure the inside diameter for capacity and halve it for the radius. A common slip is to use the diameter as r, which makes the answer four times too large. The cylinder calculator and the tank volume calculator, which also handles horizontal tanks that are partly full, avoid that trap. The circular base area is covered in how to find the area of a circle.

Example: an aquarium in inches

A tank measuring 48 × 13 × 21 inches has a volume of 13,104 in³. Since one US gallon is defined as exactly 231 cubic inches, it holds 13,104 ÷ 231 ≈ 56.7 gallons, which is why tanks this size are sold as “55-gallon” aquariums once glass thickness and the gap at the top are accounted for.

Cones and pyramids: one-third

V = ⅓ × B × h

A cone or pyramid holds exactly one-third of the prism or cylinder with the same base and height.

Cone, r = 3, h = 4: V = ⅓ × π × 9 × 4 = 12π ≈ 37.70

Square pyramid, base 6 × 6, h = 9: V = ⅓ × 36 × 9 = 108

Use the vertical height, not the slant height along the side. If you only know the slant height, find the vertical height with the Pythagorean theorem first. The cone calculator accepts either.

Tapered containers (frustums)

Buckets, flowerpots and lampshades are cones with the tip cut off, called frustums. With top radius R, bottom radius r and height h:

V = (πh ÷ 3)(R² + Rr + r²)

A pail 14 inches tall with a 6-inch top radius and a 5-inch bottom radius holds (π × 14 ÷ 3)(36 + 30 + 25) ≈ 1,334 in³, or about 5.8 gallons. The conical frustum calculator does the arithmetic.

Spheres and hemispheres

V = (4/3)πr³

Sphere, r = 5: V = (4/3) × π × 125 ≈ 523.6

Hemisphere, r = 5: half of that ≈ 261.8

Archimedes discovered a striking relationship: a cone, a hemisphere and a cylinder with the same radius r and height r have volumes in the ratio 1 : 2 : 3. He considered it his finest result. The sphere calculator works from the radius, diameter, circumference or surface area.

Scaling: why volume grows so fast

Volume depends on three dimensions, so scaling every length by a factor k multiplies the volume by k³.

Scale factor Length Area Volume
2× 2× 4× 8×
3× 3× 9× 27×
½× ½× ¼× ⅛×

A ball twice as wide holds eight times as much. This is also why a 16-inch-diameter planter needs far more than twice the soil of an 8-inch one.

Volume unit conversions

From To Multiply by
cubic feet US gallons 7.48052
cubic inches US gallons ÷ 231 (exact)
cubic yards cubic feet 27
cubic meters liters 1,000
liters cubic centimeters (mL) 1,000
cubic meters US gallons 264.172
cubic feet liters 28.3168

The gallon and inch definitions come from NIST, which publishes the official US customary unit relationships. Remember that the conversion factor for cubic units is the linear factor cubed: 1 yd = 3 ft, so 1 yd³ = 27 ft³, not 3 ft³. The volume converter handles any pair of units.

Irregular shapes

  • Break it into pieces. An L-shaped pool is two boxes; a silo is a cylinder plus a cone. Add the parts.
  • Subtract voids. A pipe’s material volume is the outer cylinder minus the inner one.
  • Use displacement. For a small solid, lower it into a measuring container of water. The rise in level equals its volume: a rise from 500 mL to 620 mL means 120 cm³.
  • Average the depth. For a pond or a sloped excavation, multiply surface area by average depth for a reasonable estimate.

Common mistakes

  • Mixing units, such as feet for length and inches for depth. Convert first.
  • Using diameter instead of radius in πr²h or (4/3)πr³.
  • Forgetting the ⅓ for cones and pyramids, or using slant height.
  • Converting cubic units with linear factors, such as dividing cubic feet by 3 instead of 27 to get cubic yards.

For bulk materials like concrete, gravel and mulch, the same box formula applies with the result in cubic yards; see how much concrete do I need. Once you know an object’s volume, its mass follows from its density, explained in how to calculate density.

Frequently asked questions

How do you calculate volume?

For prisms and cylinders, multiply the area of the base by the height. A box is length × width × height, and a cylinder is πr² × h. Cones and pyramids are one-third of that, and a sphere is (4/3)πr³.

How do I convert cubic feet to gallons?

Multiply by about 7.48, because one cubic foot holds 7.48052 US gallons. A 24-cubic-foot tank holds about 24 × 7.48 ≈ 179.5 gallons. For cubic inches, divide by 231, since one US gallon is defined as exactly 231 cubic inches.

What is the difference between volume and capacity?

Volume is the space an object takes up; capacity is how much a container can hold. For a container, capacity is measured from the inside dimensions, so thick walls make capacity smaller than the outside volume.

How do you find the volume of an irregular object?

Submerge it in water and measure how much the water level rises. The displaced volume equals the object's volume. If a rock raises the water in a measuring cup from 500 mL to 620 mL, its volume is 120 mL, or 120 cubic centimeters.

Why is a cone one-third of a cylinder?

A cone with the same base and height as a cylinder holds exactly one-third as much. This can be proved with calculus or shown by filling a cone three times to fill the matching cylinder. The same one-third factor applies to pyramids and prisms.