X-Calculator
Math Updated November 23, 2026

Volume Calculator

Find the volume and surface area of six common 3D shapes, converted to liters and gallons.

Shape
Length or side (cube, box, pyramid)
Width (box, pyramid)
Height (box, cylinder, cone, pyramid)
Radius (cylinder, sphere, cone)
Unit of the dimensions
Advertisement
Advertisement

This volume calculator finds how much space a 3D shape holds: a cube, rectangular box, cylinder, sphere, cone or rectangular pyramid. Pick the shape, enter its dimensions in inches, feet, yards, millimeters, centimeters or meters, and you get the volume in cubic units, the same volume in liters, US gallons, cubic feet and cubic meters, and the surface area. Fields the chosen shape does not use are ignored.

Volume formulas

Shape Volume Surface area Inputs used
Cube V = a³ 6a² side a
Rectangular box V = l × w × h 2(lw + lh + wh) length, width, height
Cylinder V = πr²h 2πr(r + h) radius, height
Sphere V = 4/3 πr³ 4πr² radius
Cone V = πr²h ÷ 3 πr(r + s), s = √(r² + h²) radius, height
Rectangular pyramid V = l × w × h ÷ 3 lw + l√((w/2)² + h²) + w√((l/2)² + h²) base length, base width, height

The pattern is worth remembering: prisms and cylinders are base area × height, and their pointed versions (pyramid, cone) hold exactly one third of that. A sphere fills two thirds of the cylinder that just encloses it, a result Archimedes was proud enough of to want on his tombstone.

Worked examples

  • Cylinder, r = 4 in, h = 12 in (the default): π × 4² × 12 = 603.1858 in³. One cubic inch is 16.387 mL, so that is 9.8844 L, or 2.6112 US gallons. Surface area: 2π × 4 × (4 + 12) = 402.1239 in².
  • Cube, 3 cm sides: 3³ = 27 cm³ = 27 mL = 0.027 L, with 6 × 9 = 54 cm² of surface.
  • Box, 2 × 3 × 4 ft: 24 ft³, which is 679.6 L or 179.53 US gallons.
  • Sphere, r = 5 m: 4/3 × π × 125 = 523.5988 m³, more than half a million liters.
  • Cone, r = 3 in, h = 4 in: π × 9 × 4 ÷ 3 = 37.6991 in³. The slant height is √(9 + 16) = 5 in, so the surface area is π × 3 × (3 + 5) = 75.3982 in².
  • Pyramid, 6 × 6 in base, 9 in tall: 6 × 6 × 9 ÷ 3 = 108 in³.
Advertisement
Advertisement

Practical example: how many gallons in a round pool?

A 24-ft round above-ground pool filled to 4 ft is a cylinder with r = 12 ft and h = 4 ft: π × 144 × 4 = 1,809.56 ft³. At 7.48052 US gallons per cubic foot, that is about 13,536 gallons. Fill height matters more than you might expect: every extra 6 inches adds roughly 1,700 gallons. For concrete pours, the concrete volume calculator converts cubic feet to cubic yards and bags.

Unit conversions for volume

Volume units are cubes of length units, so conversion factors are cubed too. One foot is 12 inches, but one cubic foot is 12³ = 1,728 cubic inches. One meter is 100 cm, so one cubic meter is 1,000,000 cm³, or 1,000 liters.

Unit Liters US gallons
1 in³ 0.016387 0.004329
1 ft³ 28.3168 7.48052
1 yd³ 764.555 201.974
1 cm³ (1 mL) 0.001 0.000264
1 m³ 1,000 264.172

For other units, such as imperial gallons, quarts or cups, use the volume converter or gallons to liters.

Shapes not on the list

Many other solids are combinations or fractions of these six:

  • Hemisphere: half a sphere, 2/3 πr³. A bowl with r = 5 in holds 261.8 in³ (about 1.13 gallons).
  • Capsule or propane tank: a cylinder plus one full sphere for the two rounded ends, πr²h + 4/3 πr³.
  • Triangular prism: triangle area × length, or half of the box with the same outer dimensions.
  • Truncated cone (a bucket): πh(R² + Rr + r²) ÷ 3, where R and r are the top and bottom radii.
  • Square pyramid: enter the same value for length and width.

Tips and common mistakes

  • Radius, not diameter. Halve the diameter first. Using the diameter by mistake makes a cylinder’s volume 4 times too large and a sphere’s 8 times too large.
  • Use one unit for every dimension. Convert 6 inches to 0.5 ft before mixing it with feet.
  • Height is perpendicular. For cones and pyramids, enter the vertical height from base to tip, not the slant height along the side.
  • Inside vs. outside dimensions. For tanks, boxes and pots, measure the inside to get the capacity; wall thickness can cut usable volume noticeably.
  • Usable capacity: containers are rarely filled to the brim, so plan on 85–90% of the computed volume for tanks and planters.

Frequently Asked Questions

How do you calculate volume?

For boxes and cylinders, multiply the area of the base by the height: l × w × h for a box and πr²h for a cylinder. Cones and pyramids hold one third of that, and a sphere is 4/3 πr³.

How do I convert cubic feet to gallons?

Multiply by 7.48052. For example, 24 ft³ × 7.48052 = 179.53 US gallons.

How many liters are in a cubic meter?

Exactly 1,000 liters. One liter is the volume of a 10 cm cube, which is 1,000 cm³.

What is the difference between volume and capacity?

Volume is the space an object occupies, measured with outside dimensions. Capacity is how much a container holds, measured with inside dimensions, so it is always a little smaller.

How do I find the volume of an irregular object?

Submerge it in a measuring container of water and read how much the level rises; that displaced volume equals the object’s volume. For irregular rooms or tanks, split them into boxes and cylinders and add the parts.

Advertisement
Advertisement
Related

You may also need

All Math Calculators
Advertisement