Written by Erum Nazeer Built by Muhammad Ayaz Akhtar Updated

Volume calculator

Capsule Volume Calculator

A capsule is a cylinder with a hemisphere capping each end. Enter the radius and the straight cylinder section length, not the full end-to-end length, to get the volume with working steps. This calculator covers pharmaceutical capsules, propane tanks, pressure vessels, and any rounded-end container where you need accurate capacity in liters or gallons. For a plain cylindrical tank without domed ends, see how much water a cylindrical tank holds for the simpler litres and gallons conversion.

V = πr²h + (4/3)πr³

Capsule

Enter capsule dimensions

Formula: V = πr²h + (4/3)πr³

3D visual

Capsule preview

Loading visual

First, Which Length Do You Have?

The calculator asks for the radius and the cylinder height: the straight middle section only. Many problems, and most real tanks, give you the total end-to-end length instead. Total length includes the two rounded ends, each one radius deep, so:

cylinder height h = total length − 2r

A pill-shaped container 24 cm long with a 4 cm radius has a straight section of 24 − 8 = 16 cm. Enter 16, not 24. The results panel shows the total length back to you, so you can confirm it matches your measurement. If you have a diameter, halve it for the radius.

A Cylinder Plus One Sphere

Capsule volume diagram showing cylinder section height h and hemisphere radius r labeled, with formula V = πr²h + (4/3)πr³
Capsule (pill shape) with cylinder height h and hemisphere radius r labeled showing V = πr²h + (4/3)πr³
V = πr²h + (4/3)πr³

Pull the two rounded ends off a capsule and push them together, and they make one complete sphere of the same radius. So a capsule's volume is simply cylinder volume for the middle plus sphere volume for the ends. The calculator shows both parts separately before adding them, which makes it easy to see how much of a tank's capacity sits in its domed ends.

That share grows as the capsule gets stubbier. With h = 0 the shape is just a sphere, and the formula reduces to (4/3)πr³.

Two Examples in Full

A capsule-shaped solid: r = 3 cm, h = 10 cm

  1. Middle: π × 3² × 10 = 282.74 cm³
  2. Ends: (4/3)π × 3³ = 113.10 cm³
  3. Total: 282.74 + 113.10 = 395.84 cm³

The 24 cm container from above: r = 4 cm, total length 24 cm

  1. Straight section: 24 − 2 × 4 = 16 cm
  2. Middle: π × 4² × 16 = 804.25 cm³
  3. Ends: (4/3)π × 4³ = 268.08 cm³
  4. Total: 1,072.33 cm³, just over a liter

Had you entered 24 as the cylinder height, you'd get about 1,474 cm³, about 37% too high. That single mix-up is the most common capsule error.

Tanks and Pressure Vessels

Propane tanks, air receivers, and railway tank cars use this shape because domed ends spread internal pressure evenly, with no flat panels or sharp corners to concentrate stress. Three more cases, all at full capacity:

TankRadiusStraight sectionMiddle + endsFull volume
Horizontal storage tank0.6 m2.8 m3.167 + 0.905 m³4.072 m³ (4,072 L)
Small vessel, 8 in diameter4 in14 in703.72 + 268.08 in³971.80 in³ (about 4.2 US gal)
Vertical tank1.2 ft5 ft22.62 + 7.24 ft³29.86 ft³ (about 223 US gal)

Full capacity doesn't depend on whether the tank lies flat or stands upright. Orientation matters only when it's partly full: in a horizontal tank the liquid surface cuts across the curved sides and both domes, so half the depth is not half the volume. This calculator gives the full figure; partial fill of a horizontal tank needs a segment calculation.

Two practical notes. Use inside dimensions, since vessel walls can be thick. And the water capacity on a propane tank's label is not what it's filled to: propane tanks are normally filled to about 80% to leave room for the liquid to expand. If the vessel tapers smoothly with no straight middle, like an egg-shaped digester, the Ellipsoid Volume Calculator fits better.

Liters, Gallons, and Cubic Feet

Volume unit conversion table showing cm³, mL, liters, US gallons, UK gallons, cubic feet, and cubic meters
Common volume unit conversions: cm³, mL, liters, US gallons, UK gallons, cubic feet, and cubic meters

The answer comes out in the cube of your input unit, and the calculator converts it to liters, US gallons, imperial gallons, and cubic feet. For hand checks: 1,000 cm³ = 1 liter, 1 m³ = 1,000 liters, 231 in³ = 1 US gallon, and 1 ft³ ≈ 7.48 US gallons.

How the Numbers Are Checked

The code has two lines, not one: cylinderVolume = PI * r^2 * height and capVolume = (4/3) * PI * r^3, added together for the total. The second line treats both ends as a single sphere rather than computing each hemisphere separately. The result is identical, but it avoids doing and rounding the same multiplication twice. Both terms read the same radius input, so changing it updates the middle and the ends together.

Frequently Asked Questions

How do you calculate capsule volume?

Use V = πr²h + (4/3)πr³. Calculate the middle cylinder (πr²h) and both rounded ends together as one sphere ((4/3)πr³), then add. Both terms use the same radius. If diameter is given, divide by 2 first: r = d ÷ 2.

How do you calculate capsule volume from total length?

Find cylinder height first: h = total length − 2r. For a capsule 24 cm long with radius 4 cm: cylinder height = 24 − 8 = 16 cm. Then apply the full formula.

Is horizontal capsule tank volume different from vertical?

Full capacity is identical regardless of orientation. Orientation only affects partial-fill calculations, when a horizontal tank is not full, the liquid surface cuts through the rounded ends at an angle, making depth-based estimates inaccurate.

Why does the formula use a full sphere rather than two separate hemispheres?

Two hemispheres of the same radius equal exactly one sphere, so the calculation simplifies to the sphere volume formula (4/3)πr³ for both ends combined. Calculating each hemisphere as (2/3)πr³ and doubling gives the same result, it is just one extra step with no benefit.

References