# What is the volume of my shape?

Finds the volume of a cube, box, cylinder, cone, sphere, hemisphere, pyramid, capsule, conical frustum, or ellipsoid from its dimensions.

- Page: https://www.acalculator.org/math/volume-calculator
- JSON spec: https://www.acalculator.org/math/volume-calculator.json
- Version: 6fe7fbbd2c37

## Default answer

Example with the default inputs (Shape Rectangular box, Length (l) 10, Width (w) 6, Height (h) 4): Rectangular box volume: 240 cubic units.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| shape | Shape | The solid to find the volume of. |
| s | Side (s) | The length of each edge of the cube. |
| l | Length (l) | The length of the base. |
| w | Width (w) | The width of the base. |
| h | Height (h) | The height, at right angles to the base; for a capsule, the length of its straight middle part. |
| r | Radius (r) | The radius of the circle (for a frustum, of one end). |
| r2 | Second radius (r₂) | The radius of the other end of the frustum. |
| a | Semi-axis a | Half the length of the first axis of the ellipsoid. |
| b | Semi-axis b | Half the length of the second axis of the ellipsoid. |
| c | Semi-axis c | Half the length of the third axis of the ellipsoid. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| volume | Volume | The space inside the solid, in the cube of the length unit (cm gives cm³). |
| formula | Formula | The volume formula for this shape. |

## Method

V = the shape’s standard volume formula, for example V = πr²h for a cylinder and V = 4/3 πr³ for a sphere.

## Assumptions

- Every length is more than 0 and all are in the same unit; the volume is in that unit cubed.
- Cones, pyramids, and frustums are right (the top is straight above the centre of the base).
- A capsule is a cylinder of height h with a hemisphere of the same radius on each end.

## Worked examples

1. shape = box, l = 10, w = 6, h = 4 gives volume = 240, formula = V = l × w × h. Source: hand calculation in content.mdx: 10 × 6 × 4 = 240.
2. shape = cube, s = 5 gives volume = 125. Source: hand calculation in content.mdx: 5³ = 125.
3. shape = cylinder, r = 3, h = 4 gives volume = 113.097336. Source: hand calculation in content.mdx: π × 9 × 4 = 36π; Python 3: math.pi * 3**2 * 4 = 113.09733552923255.
4. shape = cone, r = 3, h = 4 gives volume = 37.699112. Source: hand calculation in content.mdx: 36π ÷ 3 = 12π; Python 3: math.pi * 9 * 4 / 3 = 37.69911184307752.
5. shape = sphere, r = 3 gives volume = 113.097336. Source: hand calculation in content.mdx: 4/3 × π × 27 = 36π; Python 3: 4/3 * math.pi * 3**3 = 113.09733552923254.
6. shape = hemisphere, r = 3 gives volume = 56.548668. Source: hand calculation in content.mdx: half of 36π = 18π; Python 3: 4/3 * math.pi * 3**3 / 2 = 56.54866776461627.
7. shape = pyramid, l = 10, w = 6, h = 4 gives volume = 80. Source: hand calculation in content.mdx: 240 ÷ 3 = 80.
8. shape = capsule, r = 3, h = 4 gives volume = 226.194671. Source: hand calculation in content.mdx: 36π + 36π = 72π; Python 3: math.pi * 9 * 4 + 4/3 * math.pi * 27 = 226.19467105846508.
9. shape = frustum, r = 3, r2 = 2, h = 4 gives volume = 79.587014. Source: hand calculation in content.mdx: π × 4 × (9 + 6 + 4) ÷ 3 = 76π/3; Python 3: math.pi * 4 * 19 / 3 = 79.58701389094142.
10. shape = ellipsoid, a = 3, b = 2, c = 1 gives volume = 25.132741. Source: hand calculation in content.mdx: 4/3 × π × 6 = 8π; Python 3: 4/3 * math.pi * 3 * 2 * 1 = 25.132741228718345.

## FAQ

### How do I calculate volume?

Use the formula for the shape. For a box, multiply length × width × height: a 10 × 6 × 4 box holds 240 cubic units. For shapes with a constant cross-section, such as a cylinder, multiply the area of the base by the height: πr² × h.

### What units is the volume in?

The cube of the unit you measured in. Measure in centimeters and the volume is in cubic centimeters (cm³); measure in feet and it is in cubic feet (ft³). Use the same unit for every length. 1,000 cm³ is 1 liter, and 1 ft³ is about 7.48 US gallons.

### How do I find the volume of a cylinder?

Multiply π by the radius squared and by the height: V = πr²h. A cylinder with radius 3 and height 4 has a volume of π × 9 × 4 = 36π, about 113.1. If you know the diameter, halve it to get the radius first.

### 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: V = πr²h ÷ 3. The same is true for any pyramid and the prism with its base and height. The volume formula comes from adding up thin circular slices that shrink from the base to the tip.

### How do I find the volume of a sphere?

Use V = 4/3 × π × r³. A sphere with radius 3 has a volume of 4/3 × π × 27 = 36π, about 113.1. A hemisphere is half of that.

### What is a conical frustum?

A cone with its tip cut off by a cut parallel to the base, like a bucket or a lampshade. With end radii r and r₂ and height h, V = πh(r² + r × r₂ + r₂²) ÷ 3.

## Sources

- OpenStax, Prealgebra 2e, section 9.6 Solve Geometry Applications: Volume and Surface Area: https://openstax.org/books/prealgebra-2e/pages/9-6-solve-geometry-applications-volume-and-surface-area
- Zwillinger (ed.), CRC Standard Mathematical Tables and Formulae, 33rd ed., CRC Press, 2018, section 4 (geometry of solids)
