Volume Calculator: 8 Shapes, Exact π, Liters & Gallons

Nearly every volume formula comes from one idea: the area of the base times the height. A box, a cylinder and a triangular prism all work that way. Shapes that narrow to a point, such as cones and pyramids, hold exactly a third of that. A sphere is the one round exception with its own rule, ⁴⁄₃πr³.

Pick a shape below and type its measurements. The calculator gives the volume, the surface area and every step. Round shapes get an exact answer in terms of π, such as 90π, beside the decimal. Choose a unit and it also converts the volume to liters, US gallons and cubic feet.

Volume & Surface Area Calculator

Use the same unit for every length. You can type 7, 2.5, 3/4 or 1,200. Pick a unit to see liters and US gallons.

Volume –
The shape (labels, not to scale)
Step by step

    Eight Shapes, One Table of Formulas

    ShapeWhat you measureVolumeSurface area
    Box (rectangular prism)length l, width w, height hV = lwhA = 2(lw + lh + wh)
    Cubeside sV = s³A = 6s²
    Cylinderradius r, height hV = πr²hA = 2πr² + 2πrh
    Coneradius r, height hV = ⅓πr²hA = πr² + πr√(r² + h²)
    Sphereradius rV = ⁴⁄₃πr³A = 4πr²
    Hemisphereradius rV = ⅔πr³A = 3πr² (curved 2πr² + flat πr²)
    Rectangular pyramidbase l × w, height hV = ⅓lwhbase + four triangles
    Triangular prismtriangle base b, triangle height t, length LV = ½btLtwo triangles + three rectangles

    Read the volume column with the base-times-height idea in mind. A cylinder’s base is a circle of area πr², so V = πr² × h. A triangular prism’s base is a triangle of area ½bt, so V = ½bt × L. A cone sits on the same circle as a cylinder and a pyramid sits on the same rectangle as a box, so each gets the same product with ⅓ in front.

    The heights in these formulas are always measured straight up, at a right angle to the base. For a cone or pyramid, the height runs from the tip down to the center of the base, not along the sloping side. The sloping length is the slant height. It’s only needed for surface area, and the calculator works it out with the Pythagorean theorem.

    Radius or Diameter? The Mistake That Quadruples the Answer

    Round shapes are measured with a radius, but a ruler laid across the top gives you the diameter: straight across, through the middle. Typing the diameter where the formula wants the radius is the costliest slip on this page.

    Take a cylinder 6 cm across and 10 cm tall. The radius is 3 cm:

    • Correct: V = π × 3² × 10 = 90π ≈ 282.74 cm³
    • Using 6 as the radius: V = π × 6² × 10 = 360π ≈ 1,130.97 cm³

    The wrong answer is exactly 4 times too big, because the radius is squared. For a sphere the radius is cubed, so the same slip makes the answer 8 times too big. A ball 10 inches across has a volume of 500π/3 ≈ 523.6 in³. With 10 used as the radius, you’d get 4,188.8 in³.

    The calculator has a switch under the boxes for round shapes: “I know the radius” or “I know the diameter”. Choose diameter and it halves your number first, and the steps show it doing so.

    Why Cones and Pyramids Get a Third

    The ⅓ isn’t a rough guess. A cone holds exactly one third of the cylinder with the same base and height, and a pyramid holds exactly one third of the matching box.

    You can see it with a cube. Pick one corner and join it to every other corner. The cube splits into three identical square pyramids. Each has the cube’s face as its base and the cube’s edge as its height. Three of them fill the cube, so each is ⅓s³. Fill a paper cone with rice and pour it into a cylinder of the same size, and it takes three cones to fill it.

    Spheres have a neat match too. Archimedes showed that a sphere fills exactly ⅔ of the smallest cylinder it fits in, a cylinder of radius r and height 2r. That cylinder holds πr² × 2r = 2πr³, and ⅔ of that is ⁴⁄₃πr³, the sphere formula. The calculator notes these comparisons under the answer.

    Keep π Until the End

    π never ends, so any decimal you use for it is rounded. Rounding it early adds error that rounding at the end avoids.

    Take a ball with a radius of 10 cm:

    Value used for πVolume
    exact π, written as 4000π/34,188.7902… cm³
    3.144,186.6667 cm³
    22/74,190.4762 cm³

    3.14 comes out about 2.12 cm³ short here. That sounds small, but the error grows with the size of the shape. For a water tank of radius 3 m and height 10 m, using 3.14 instead of π leaves out about 0.143 m³. That’s 143 liters.

    That’s why the calculator shows 4000π/3 first. The π form is exact, and you can carry it into the next step of a problem. The decimal next to it uses the full value of π, rounded only at the end to the places you choose.

    From Cubic Units to Liters and Gallons

    Volume comes out in cubic units: cm³, m³, in³, ft³. Containers and liquids are sold in liters and gallons. The definitions behind them are exact, from NIST’s tables of US units, and the rounded values follow from those:

    FactValue
    1 liter1,000 cm³ (one cubic decimeter)
    1 m³1,000 liters
    1 inch2.54 cm exactly
    1 US gallon231 in³ exactly ≈ 3.785 liters
    1 ft³1,728 in³ ≈ 7.481 US gallons ≈ 28.317 liters
    1 yd³27 ft³

    A UK (imperial) gallon is bigger, 4.54609 liters, so check which gallon a recipe or product means.

    Example: a fish tank. A tank 48 inches long, 13 inches wide and 21 inches tall holds 48 × 13 × 21 = 13,104 in³. Divide by 231 for gallons: about 56.73 US gallons, or about 214.7 liters. A tank’s advertised size may be rounded, and the glass and gravel take up some of the space, so the water inside is a bit less.

    Pick a unit in the calculator and it shows liters, US gallons and either cubic feet or cubic meters. All of them come from the exact factors above.

    Cubic Units Grow Faster Than You Think

    A meter is 100 centimeters, but a cubic meter is not 100 cubic centimeters. It’s 100 × 100 × 100 = 1,000,000 cm³, because every one of the three directions gets multiplied. Converting a volume with the plain length factor is an easy way to end up a million times off.

    The same cubing explains how size changes things:

    • Double every length of a shape and its volume grows 8 times (2³).
    • Its surface area grows only 4 times (2²).
    • Triple every length and the volume grows 27 times.

    It’s one reason big containers use less material per liter: the surface grows more slowly than what they hold. For more on powers like these, see the Exponent Calculator.

    Surface Area: Paint, Wrap and Labels

    Surface area is the total area of every face, measured in square units. Before you use the number, decide which faces actually count:

    • Open box or aquarium without a lid: five faces, not six. Take away the top, lw.
    • Label on a can: only the curved side, 2πrh. The two circles aren’t covered.
    • Can with both lids: 2πr² + 2πrh.
    • Bowl: a hemisphere’s curved part only, 2πr². The flat circle is the opening.
    • Tent (triangular prism) with a floor: two triangles and three rectangles. Without a floor, leave out the base rectangle, bL.

    The calculator gives the full surface area for every shape. For cylinders and hemispheres it also shows the curved part on its own.

    For a cone, the curved part is πr × s, where s is the slant height. For a cone of radius 3 and height 4, the slant height is √(3² + 4²) = 5. The surface area is 9π + 15π = 24π ≈ 75.40, and the volume is ⅓π × 9 × 4 = 12π ≈ 37.70.

    Pyramids and Prisms: Which Length Is Which

    These two shapes ask for three lengths that are easy to mix up, and a swap gives a wrong answer without any warning.

    Pyramid: height, not slant height. Take a pyramid with a 6 × 4 base and a height of 5. Its volume is ⅓ × 6 × 4 × 5 = 40. The faces slope, though, and the slant height up the middle of the faces on the 6-unit edges is √(5² + 2²) = √29 ≈ 5.39. Measure along a face and use that by mistake and you get ⅓ × 6 × 4 × 5.39 ≈ 43.08, about 8% too much. The calculator asks for the vertical height and works out both slant heights itself for the surface area.

    Triangular prism: two heights. A prism has a triangle at each end and a length between them. The volume needs the triangle’s base b and the triangle’s height t (measured straight up from that base), then the prism’s length L. In the tent example in the practice set, the triangle is 6 ft wide and 4 ft tall, and the tent is 10 ft long. Mixing up t and L changes nothing for the volume, because all three multiply. It does change the surface area, so label them carefully.

    The surface area here assumes the triangle’s two sloping sides are equal, as on a tent or a simple roof. For a lopsided triangle, add the three rectangles yourself, each one side of the triangle × L.

    How Many Decimals to Keep

    An answer can’t be more precise than the measurements behind it. A box measured to the nearest centimeter as 50 × 30 × 40 cm gives 60,000 cm³. Each length could really be half a centimeter either way, so writing 60,000.00 suggests precision that isn’t there.

    A practical rule: keep a few extra places while working, then round the final answer to about as many significant figures as your least precise measurement. The calculator’s “Round to” menu sets 2, 3, 4 or 6 decimal places, and the exact π form is always there if you need to carry the value further.

    Real Jobs: Concrete, Soil, Pools and Tanks

    Concrete slab. A patio 10 ft by 12 ft and 4 inches thick: convert the thickness first, 4 in = 4/12 ft. Then V = 10 × 12 × 4/12 = 40 ft³. Concrete is sold by the cubic yard, so divide by 27: about 1.48 yd³. Order a little more than you calculate, because ground is rarely perfectly level.

    Round column. A form tube 12 inches across and 4 ft tall has a radius of 0.5 ft. V = π × 0.5² × 4 = π ft³ ≈ 3.14 ft³. Six columns need about 18.85 ft³, or 0.70 yd³.

    Water tank. A cylinder with a radius of 3 ft and a height of 6 ft holds 54π ≈ 169.65 ft³. Multiply by 1,728 and divide by 231 to get gallons: about 1,269 US gallons.

    Pool. A pool 32 ft by 16 ft with an average depth of 5 ft holds 32 × 16 × 5 = 2,560 ft³, about 19,150 US gallons. For a sloped floor, the average of the shallow and deep ends works when the slope is even.

    Volume doesn’t tell you what fits. A box 20 cm on each side has a volume of 8,000 cm³. A cube 5.7 cm on each side has a volume of about 185.19 cm³. Dividing suggests 43 cubes fit, but only 3 fit along each edge (3 × 5.7 = 17.1 cm), so just 3 × 3 × 3 = 27 go in. Volume gives an upper limit for packing, not the answer.

    Measuring Real Objects

    A formula is only as good as the lengths you put into it. Four things trip people up with real objects.

    Inside or outside? A planter’s outside size tells you how much space it takes up on the patio. Its inside size tells you how much soil it holds. For a box with walls 1 inch thick, subtract 2 inches from each outside length and 1 inch from the height if the bottom is 1 inch thick too. An outside size of 24 × 12 × 12 inches becomes 22 × 10 × 11 inside. That’s 2,420 in³ instead of 3,456 in³, about 30% less.

    Can’t reach across the middle? Wrap a tape measure around a round tank to get its circumference C, then divide: r = C ÷ 2π. A tank 377 cm around has a radius of about 60 cm. That’s easier than finding the exact middle of a wide circle.

    Odd shapes. For a stone, a toy or anything without a formula, use water. Put the object in a measuring jug and see how far the level rises. Because 1 mL is exactly 1 cm³, a rise from 500 mL to 620 mL means the object’s volume is about 120 cm³. This is the displacement idea linked with Archimedes.

    Mixed units. Convert every length to one unit before you multiply. A box 2 ft long, 18 in wide and 6 in tall is 24 × 18 × 6 = 2,592 in³, or 2 × 1.5 × 0.5 = 1.5 ft³. Both are right, and 1.5 × 1,728 = 2,592 confirms it. Mixing feet and inches in one product gives a number that means nothing.

    Volume, Capacity and Weight

    Volume is the space a solid takes up. Capacity is how much a hollow container can hold inside. For a thin container they’re nearly the same; for a thick one, use the inside lengths as described above.

    Volume also gives you weight once you know what fills the space. Water is the easy case: a liter of water has a mass of about 1 kg. The 1,269-gallon tank from earlier holds about 4,800 liters, so the water alone is about 4,800 kg, more than 10,000 pounds. That’s worth knowing before you put a tank on a deck or a roof.

    For other materials, multiply volume by density (mass per unit volume) from the supplier or a reference table. Keep the units matched: density in kg per m³ needs the volume in m³.

    Composite Shapes: Add and Subtract

    Many real objects are two simple shapes joined together or one cut out of another. Work out each part, then add or subtract.

    Grain silo (cylinder + hemisphere dome). Radius 3 m, cylinder part 12 m tall:

    • Cylinder: π × 3² × 12 = 108π
    • Dome: ⅔ × π × 3³ = 18π
    • Total: 126π ≈ 395.84 m³

    Keeping both parts in terms of π makes them easy to add. That’s one more reason the calculator shows the π form.

    Pipe or tube (big cylinder − small cylinder). Outer radius 5 cm, inner radius 4 cm, length 100 cm:

    V = π × 5² × 100 − π × 4² × 100 = π × (25 − 16) × 100 = 900π ≈ 2,827.43 cm³ of material.

    Subtract the squares of the radii, not the radii themselves. 5 − 4 = 1 would give only 100π, wrong by a factor of 9.

    Ice cream cone with a scoop: cone + hemisphere with the same radius. Capsule (pill shape): cylinder + one whole sphere, since its two half-spheres make a full one.

    Working Backwards From a Volume

    Sometimes you know the volume and need a length. Rearrange the formula:

    • Cylinder height: h = V ÷ (πr²). A 2-liter (2,000 cm³) bottle with a radius of 4 cm needs a height of 2000 ÷ (16π) ≈ 39.79 cm.
    • Cube side: s = ∛V. A tank that holds 1,000 liters (1 m³) as a cube has 1 m sides.
    • Sphere radius: r = ∛(3V ÷ 4π). A ball holding 1,000 cm³ has a radius of about 6.20 cm.
    • Box height: h = V ÷ (lw).

    The calculator works forwards, from lengths to volume. Use these rearranged formulas to find a length, then put it back into the calculator to check the volume.

    Questions About Volume

    1. Is volume squared or cubed? Cubed. Volume multiplies three lengths, so its units are cubed: cm³, m³, ft³. Area multiplies two lengths and is squared.
    2. Does a tilted cylinder have a different volume? No. A slanted (oblique) cylinder or a leaning stack of coins has the same volume as a straight one with the same base and the same vertical height. This is Cavalieri’s principle: if every horizontal slice has the same area, the volumes match. Use the vertical height, not the length of the slanted side.
    3. Why does my answer have π in it? π is part of every circle’s area, so it stays in the exact volume of a cylinder, cone or sphere. 90π cm³ is the exact answer. 282.74 cm³ is that answer rounded.
    4. How many liters are in a cubic foot? About 28.317. Also, 1 ft³ ≈ 7.481 US gallons, and 1 m³ ≈ 264.17 US gallons.
    5. Can a volume be negative? Not for a real object. If a subtraction in a composite shape gives a negative answer, the part you removed is bigger than the part you started with. Check the dimensions.

    Practice: Six Problems With Answers

    Try each one, then check it in the calculator.

    1. A box 5 × 4 × 3 m. Volume and surface area?
    2. A cylinder with a diameter of 8 in and a height of 5 in. Volume?
    3. A cone of radius 3 and height 4. Slant height?
    4. A sphere of radius 6 cm. Volume in cm³ and in liters?
    5. A rectangular pyramid with a base 6 × 4 and a height of 5. Volume?
    6. A tent shaped like a triangular prism: triangle base 6 ft, triangle height 4 ft, length 10 ft. Volume and surface area?

    Answers:

    1. V = 60 m³; A = 2(20 + 15 + 12) = 94 m².
    2. r = 4, so V = π × 16 × 5 = 80π ≈ 251.33 in³.
    3. s = √(9 + 16) = 5.
    4. V = 288π ≈ 904.78 cm³ ≈ 0.905 liters.
    5. V = ⅓ × 6 × 4 × 5 = 40.
    6. V = ½ × 6 × 4 × 10 = 120 ft³. The sloping sides are √(3² + 4²) = 5 ft, so A = 24 + 60 + 100 = 184 ft². That’s two triangles of 12 each, a 6 × 10 floor and two 5 × 10 sides.

    For very large or very small volumes, such as a planet or a cell, write the answer with the Scientific Notation Calculator.