The Calc Guide › Calculator

Volume Calculator

Volume is worked out from each shape’s own formula: a cylinder is pi x radius squared x height, and a sphere is (4/3) x pi x radius cubed. This calculator covers nine shapes (cube, box, cylinder, sphere, cone, square pyramid, ellipsoid, capsule, hemisphere) in centimeters, meters, inches or feet, giving you every result in cubic units, liters and US gallons: a sphere of radius 3 cm is 113.097 cm3. Checked November 2026.

Last updated: November 26, 2026

Work out the volume of nine shapes

Use the radius, half the diameter, wherever a shape asks for r. For a capsule, the straight section is the cylindrical middle only; the two rounded ends are added for you.

How this is worked out

Pick a shape and the formula appears here with your numbers in it.

The volume is also given in liters and US gallons.

Volume-
In liters-
In US gallons-

Next: plan a garden bed with the Mulch Calculator

Free. No sign-up. Calculated in your browser; nothing is sent to our servers.

What this calculator does

The Volume Calculator holds nine shapes in one tool: cube, rectangular box, cylinder, sphere, cone, square pyramid, ellipsoid, capsule and hemisphere. Pick a shape and only the measurements it needs appear. Pick one length unit, centimeters, meters, inches or feet, and every result comes back three ways at once: in cubic units, in liters and in US gallons, so a tank, a planter or a parcel is answered in the unit you actually buy, pour or ship by, without a second conversion page.

Worked example: the cylinder the tool opens on

The tool above opens on a cylinder with radius 5 cm and height 10 cm, and reads 785.398 cm3, which is 0.785398 liters and 0.20748 US gallons. The working in the tool shows the formula with those numbers in it: pi x 5^2 x 10. The other shapes at their own example sizes, each of which reproduces exactly when you choose the shape and type the measurements in:

Scroll sideways to see all columns →

Shape and measurements (cm) Volume In liters
Cube, side 10 1,000 cm3 1
Box, 30 x 20 x 15 9,000 cm3 9
Sphere, radius 3 113.097 cm3 0.113097
Cone, radius 3, height 9 84.823 cm3 0.084823
Square pyramid, base side 6, height 10 120 cm3 0.12
Ellipsoid, semi-axes 3, 2 and 1.5 37.6991 cm3 0.037699
Capsule, radius 2, cylinder height 8 134.041 cm3 0.134041
Hemisphere, radius 5 261.799 cm3 0.261799

The formula for every shape

Every shape carries a formula of its own, and the tool shows the one you picked with your numbers substituted into it. In these formulas r is a radius, h is a height, and pi is the circle constant, about 3.14159.

  • Cube: V = s^3, the side multiplied by itself three times.
  • Rectangular box: V = l x w x h, length times width times height.
  • Cylinder: V = pi x r^2 x h, the area of the round base times the height.
  • Sphere: V = (4/3) x pi x r^3.
  • Cone: V = (1/3) x pi x r^2 x h, exactly a third of the cylinder on the same base.
  • Square pyramid: V = (1/3) x b^2 x h, a third of the box on the same square base, where b is the base side.
  • Ellipsoid: V = (4/3) x pi x a x b x c, where a, b and c are the three semi-axes, each half the full width in its direction.
  • Capsule: V = pi x r^2 x h + (4/3) x pi x r^3, a cylinder plus its two rounded end caps, which together make one whole sphere. Here h is the straight middle section only.
  • Hemisphere: V = (2/3) x pi x r^3, exactly half a sphere.

Getting the measurements right

  • Radius, not diameter: every round shape here takes a radius, the distance from the center to the edge. If you measured straight across a pipe, a pot or a ball, halve that number before typing it in. Entering a diameter as a radius overstates a cylinder or sphere eightfold in the worst case, because the radius is squared or cubed.
  • The capsule height: on the capsule, the height field is the straight cylindrical section between the two caps, not the full tip to tip length. If you know the full length, subtract one diameter (twice the radius) to get the section this tool wants.
  • Semi-axes on the ellipsoid: the three fields are half-widths. Measure the full width, depth and height of the object and halve each one.
  • One unit throughout: the unit select applies to every measurement on the shape. A box measured in feet and inches has to be settled into one of them first; the Mulch Calculator below is built for garden beds measured the mixed way.

For a shape at room scale the liter figure is usually the one to read: a cylindrical tank of radius 0.5 m and height 2 m (choose meters in the tool) holds 1.5708 cubic meters, which is 1,570.8 liters or 414.96 US gallons.

Limits of the tool

The tool works out one shape at a time, in one length unit. A negative measurement is treated as 0, so it gives a volume of 0 and no warning. Leaving every measurement for the shape blank shows dashes. A measurement of 0 gives a volume of 0. The pyramid is a square pyramid only, with one base side. A capsule with a straight section of 0 is a sphere. There is no cap on the numbers, but a very large entry is more than the tool can show: past a cube side of about 6 x 10^102 the result reads as a dash, so check an entry before relying on it. Results are shown to six significant figures at most, and they describe a perfect shape: a real tank, pot or planter with sloped sides or rounded corners will differ.

Sources and method

The nine formulas are the standard results of solid geometry, the ones given in school geometry texts for the box, cylinder, cone, pyramid, sphere and hemisphere, with the ellipsoid and the capsule following from the same method (the capsule is a cylinder plus one whole sphere). Each is reproduced in the formulas card above so the method is on the page. The conversions rest on exact definitions: the liter is a special name for the cubic decimeter, so it is exactly 1,000 cubic centimeters and a cubic meter is exactly 1,000 liters (NIST Handbook 44, Appendix C); the inch is exactly 2.54 cm, which makes a cubic foot exactly 28.316846592 liters; and the US gallon is exactly 231 cubic inches, exactly 3.785411784 liters (NIST SP 811). The tool computes at full precision and rounds only the display; the figures printed on this page show up to six significant figures. One caution carried on the page: the imperial gallon used in the UK and Canada is larger, exactly 4.54609 liters (UK Weights and Measures Act 1985). This tool gives US gallons throughout. Figures checked November 2026.

Related calculators

The Mulch Calculator turns a bed’s length, width and depth into cubic yards and bag counts for the garden. The Kg to Lbs Calculator converts the weight of what fills the space, and the Percentage Calculator handles fill levels and part full amounts, like a tank at 60 percent. The diagonal across a box like this one is found by the Pythagorean theorem calculator, applied twice. How steeply the side of a solid like this one rises is measured by the slope calculator, as rise over run.

Change log

November 18, 2026: checked the ellipsoid liters figure against the tool display and the live figure of 0.037699 stands; reworded two unsourced superlatives; added the NIST and UK Weights and Measures Act references for the liter, the US gallon and the imperial gallon; added a limits section and two FAQs for the Search Console queries about a rectangle and about dimensions to liters.

Frequently asked questions

How do I work out the volume of a box?

Multiply length by width by height, all in the same unit. A box 30 cm by 20 cm by 15 cm is 30 x 20 x 15 = 9,000 cm3, which is 9 liters. That is the rectangular box shape in the tool above.

How do I work out the volume of a cylinder?

Square the radius, multiply by pi, then multiply by the height. The cylinder the tool opens on, radius 5 cm and height 10 cm, is pi x 25 x 10 = 785.398 cm3, about 0.785 liters. The same working holds in feet, meters or inches; only the unit select changes, and the answer comes back in that unit cubed.

How many liters are in a cubic meter?

Exactly 1,000. A liter is defined as 1,000 cubic centimeters and a cubic meter is a million cubic centimeters, so the two meet at exactly a thousand liters, with no rounding in the conversion. Put the other way round, a liter is a cube 10 cm on each side, and a cubic centimeter is a liter cut into a thousand pieces.

Is a cubic centimeter the same as a milliliter?

Yes, exactly. One cubic centimeter is one milliliter by definition, so the sphere of radius 3 cm in the examples, 113.097 cm3, is also 113.097 mL, and 0.113097 liters. That is why medicine measures marked in cc and mL are interchangeable, and why a drink label can print either unit for the same amount.

Are US gallons and imperial gallons the same?

No. A US gallon is exactly 3.785411784 liters. An imperial gallon, used in the UK and Canada, is 4.54609 liters, about 20 percent larger. This tool gives US gallons; if a product is specced in imperial gallons, work from the liter figure instead.

Does the tool take a radius or a diameter?

A radius, on every round shape. If the measurement you have goes straight across the circle, that is the diameter, and half of it is the radius the tool wants. Typing a diameter in as a radius is an easy volume mistake to make: on a sphere it inflates the answer eightfold, and on a cylinder fourfold.

What is the volume of a rectangle?

A rectangle is flat, so it has an area and no volume. The solid with rectangular faces is the rectangular box, whose volume is length x width x height. Give a 30 cm by 20 cm rectangle a height of 15 cm and it becomes the box in the examples above, with a volume of 9,000 cm3, which is 9 liters.

How do I convert dimensions to liters?

Multiply the dimensions in one unit to get cubic units, then convert. In centimeters, divide cubic centimeters by 1,000; in meters, multiply cubic meters by 1,000; in inches, multiply cubic inches by 0.016387064; in feet, multiply cubic feet by 28.316846592. A box 40 cm by 30 cm by 20 cm is 24,000 cm3, which is 24 liters, and a box 12 in by 10 in by 8 in is 960 in3, which is 15.7316 liters.

Embed this calculator

Put this calculator on your own site or blog, free, with this snippet:

Free for any site while the attribution link under the calculator stays in place. More calculators and WordPress instructions.

Educational tool only. Results are estimates based on the numbers you enter and the assumptions explained on this page, not financial advice.