Math Tools

Volume Calculator: Cube, Box, Cylinder, Sphere, Cone and Pyramid

Pick a shape, enter its measurements and get the volume in cubic units, liters and US gallons, with the formula shown so you can check the working. It covers a cube, a rectangular box, a cylinder, a sphere, a cone and a rectangular pyramid in centimeters, meters, inches or feet.

01

Your inputs

Start with the example, or enter your own values.

Processed in your browser. Your inputs stay on this device.

02

Your result

A little clarity, coming right up.

Make room for the answer.

Enter your values and run the tool. Your result will appear here.

How to use the Volume Calculator

Choose the shape and the unit, enter the side, length or radius, and add the width or height if the shape needs it. Press Calculate to see the volume, liters and gallons.

Read more: How to Use the Volume Calculator: Steps and a Worked Example

Which measurements each shape needs

A cube needs one side and a sphere one radius. A cylinder and a cone need a radius and a height. A box and a rectangular pyramid need a length, a width and a height. For round shapes use the radius, half of the diameter: a pipe 10 cm across has a 5 cm radius.

From cubic units to liters and gallons

One liter is 1,000 cm³, so a 10 cm cube holds exactly 1 liter. One cubic foot is about 28.32 liters or 7.48 US gallons, so a 4 × 3 × 2 ft tank of 24 ft³ holds about 680 liters or 179.5 gallons.

The formula

Cube: side³. Box: length × width × height. Cylinder: π × r² × h. Sphere: 4/3 × π × r³. Cone: 1/3 × π × r² × h. Pyramid: length × width × height ÷ 3.

Examples

  • Cube with 10 cm sides
    Volume: 1,000 cm³
    In liters: 1 L
    In US gallons: 0.2642 gal
    Formula: V = side³
  • Box 4 × 3 × 2 ft
    Volume: 24 ft³
    In liters: 679.6043 L
    In US gallons: 179.5325 gal
    Formula: V = length × width × height
  • Cylinder, radius 5 cm, height 20 cm
    Volume: 1,570.7963 cm³
    In liters: 1.5708 L
    In US gallons: 0.415 gal
    Formula: V = π × r² × h

Limitations and assumptions

Assumes perfect shapes. For a cylinder or cone, enter the radius, which is half the diameter.

Frequently asked questions

What is the formula for the volume of a cube?

Volume = side × side × side, or side³. A cube with 10 cm sides holds 10 × 10 × 10 = 1,000 cm³, which is exactly 1 liter.

How do I find the volume of a cylinder?

Multiply π by the radius squared and by the height. A can with a 5 cm radius and 20 cm height holds π × 25 × 20 ≈ 1,570.8 cm³, about 1.57 liters.

How do I convert cubic feet to gallons?

One cubic foot holds about 7.48 US gallons. Choose feet as the unit and the result shows liters and gallons for you.