Part of the Everyday math toolkit

Volume Calculator

Pick a shape, type its measurements — exact volume out, from cubic inches to US gallons.

Calculate the volume of a cube, rectangular prism, cylinder, sphere, cone, triangular prism or pyramid with the exact solid-geometry formula, shown on-page as you work. Switch to Standard to measure in inches, feet, centimeters or meters and get results in cubic inches, cubic feet, liters or US gallons; Detailed adds capsule, hemisphere and ellipsoid; Advanced solves the classic hard one — how many gallons are in a partly filled horizontal tank.

No cookies · No trackingYour data never leaves your browserResults update as you type
Reviewed July 2026. Uses exact US customary definitions — 1 inch = 2.54 cm, 1 US gallon = 231 cubic inches, 1 liter = 1,000 cm³ — so every unit conversion is exact rather than rounded. The formulas are the standard solid-geometry results (πr²h for a cylinder, 4/3πr³ for a sphere, the one-third rule for cones and pyramids, the circular-segment formula for a horizontal tank) as catalogued by Wolfram MathWorld and NIST.

Formulas are exact; tape measures aren't. For containers, use inside dimensions — walls, substrate and headspace all steal capacity from the nominal number.

V = πr²h
in
in
Results update as you type
Results
226.19 in³
cubic inches — V = πr²h
Every conversion here is exact — 231 in³ per US gallon, 2.54 cm per inch, 1,000 cm³ per liter. What's rarely exact is the measuring: use inside dimensions for containers, halve any diameter before entering it as a radius, and keep all dimensions in the same unit. The water-weight line assumes fresh water at roughly 8.34 lb per gallon.
Shape sketch
The geometry, worked through

Volume formulas for every shape, with worked examples

The ten formulas this calculator uses

Every formula below is exact — each example is computed straight from the formula, in inches:

ShapeFormulaWorked example
CubeV = s³s = 4 → 64 in³
Rectangular prismV = l × w × h12 × 8 × 6 → 576 in³
CylinderV = πr²hr = 3, h = 8 → 72π = 226.19 in³
SphereV = (4/3)πr³r = 6 → 288π = 904.78 in³
ConeV = (1/3)πr²hr = 3, h = 8 → 24π = 75.40 in³
Triangular prismV = ½ × b × t × lb = 6, t = 4, l = 10 → 120 in³
PyramidV = (1/3) × l × w × h6 × 6 base, h = 9 → 108 in³
CapsuleV = πr²h + (4/3)πr³r = 2, h = 6 → 108.91 in³
HemisphereV = (2/3)πr³r = 6 → 144π = 452.39 in³
EllipsoidV = (4/3)πabca = 4, b = 3, c = 2 → 32π = 100.53 in³

Two rules cover most of the table

Prisms: base area × length. Any solid with a constant cross-section — box, cylinder, triangular prism — is just its cross-section area times its length. That's why the cylinder is πr² (circle area) × h and the triangular prism is ½bt (triangle area) × l.

Tapered solids: one third of the prism. Any solid that tapers from a full base to a point — cone, pyramid — holds exactly one third of the matching prism. The cone example above (75.40 in³) is precisely a third of the cylinder example (226.19 in³), same radius, same height.

Radius, not diameter. A tape measure across a pipe, tank or ball gives the diameter — every round formula wants half of it. Because the radius is squared (or cubed, for spheres), entering the diameter doesn't double the answer, it quadruples it — or octuples it for a sphere.

Cubic inches, liters and gallons — the exact conversions

Every factor below is exact or shown to six figures

UnitEqualsAlso equals
1 US gallon231 in³ (exact)3.785411784 L (exact) · 0.133681 ft³
1 cubic foot1,728 in³28.3168 L · 7.48052 gal
1 liter1,000 cm³ (exact)61.0237 in³ · 0.264172 gal
1 cubic meter1,000 L35.3147 ft³ · 264.172 gal
1 cubic inch16.387064 cm³ (exact)2.54³, because 1 in = 2.54 cm exactly
1 cubic yard27 ft³46,656 in³ · 201.974 gal

Why 3.785411784 is exact, not rounded

The chain is definitions all the way down: the US gallon is defined as 231 cubic inches, the inch is defined as exactly 2.54 cm, and the liter is exactly 1,000 cm³. So one gallon = 231 × 2.54³ = 231 × 16.387064 = 3,785.411784 cm³ — every digit is meaningful. This calculator carries these exact factors through every conversion, so the gallons and liters lines in the breakdown agree to the last digit.

US vs imperial gallon. The imperial (UK) gallon is a different unit — exactly 4.54609 L, about 20% larger than the US gallon's 3.785 L. A "50-gallon" drum spec, fuel-economy figure or recipe from a UK source is not talking about the same gallon this page calculates.

The partly filled horizontal tank — circular-segment formula

Why a dipstick doesn't read in gallons

A horizontal cylindrical tank — fuel-oil tank, water trough, propane shell — filled to depth d holds a circular segment of liquid. The filled cross-section area is:

A = r² · arccos((r − d) / r) − (r − d) · √(2rd − d²)

and the volume is simply A × tank length. The Advanced level runs this for any diameter, length and depth, in any unit, with gallons out.

Worked example

Tank 48 in diameter (r = 24), 72 in long, dipstick reads 12 in: A = 576 × arccos(0.5) − 12 × √432 = 603.19 − 249.42 = 353.77 in². Volume = 353.77 × 72 = 25,471 in³ ÷ 231 = 110.27 gallons, out of a full capacity of π × 24² × 72 = 130,288 in³ = 564.02 gallons.

Depth ≠ volume: the dipstick curve

Notice the example: 12 inches is 25% of the tank's depth but only 19.6% of its volume, because the circle narrows toward the bottom. The full curve for any horizontal cylinder:

Depth (% of diameter)Volume (% of capacity)
10%5.2%
20%14.2%
25%19.6%
50%50.0%
75%80.4%
90%94.8%

Real tanks read slightly higher. Most commercial tanks have dished or domed ends rather than flat ones, which add a few percent beyond the straight-shell figure this formula gives. Use the shell length between the seams for a conservative number.

Concrete, water weight and aquariums — volume on the job

Concrete: think in cubic yards

US ready-mix is ordered by the cubic yard (27 ft³). Model a slab as a rectangular prism with the thickness converted to feet: a 10 × 10 ft slab at 4 in thick is 10 × 10 × (4 ÷ 12) = 33.33 ft³ = 1.23 yd³. Order about 10% extra for spillage and an uneven subgrade — call it 1.4 yd³. Weight check before you barrow it: concrete runs about 150 lb per cubic foot, so even this small slab is roughly 5,000 lb of material.

Water: volume is weight

Fresh water weighs about 8.34 lb per US gallon (1 kg per liter). That turns any volume answer into a load estimate: a 55-gallon drum of water is ~459 lb, and a garden pond of 2 m³ (2,000 L) is about two metric tons. The calculator's breakdown includes this water-weight line automatically for every shape.

Aquariums: inches ÷ 231

Tank sizes come straight from the box formula: a 24 × 12 × 16 in tank is 4,608 in³ ÷ 231 = 19.95 gallons — the standard "20-gallon". Measure inside the glass and up to the real waterline: wall thickness, substrate and headspace typically leave true water volume 10–15% below the nominal size, which matters when dosing treatments or sizing a heater. And mind the floor — that 20-gallon runs ~166 lb of water before glass, stand and rock.

Frequently asked questions

How do you calculate the volume of a cylinder?

Use V = πr²h: square the radius, multiply by π, then multiply by the height. For a cylinder with a 3 inch radius and 8 inch height, V = π × 3² × 8 = 72π = 226.19 cubic inches. Since a US gallon is exactly 231 cubic inches, that cylinder holds just under a gallon — 226.19 ÷ 231 = 0.98 gal. The most common error is using the diameter where the formula wants the radius: a tape measure across a pipe or tank reads the diameter, so halve it first. Because r is squared, plugging in the diameter inflates the volume four-fold.

How do you calculate the volume of a sphere?

Use V = (4/3)πr³. For a sphere with a 6 inch radius: (4/3) × π × 6³ = (4/3) × π × 216 = 288π = 904.78 cubic inches. If you measured the diameter d instead, the equivalent form is V = πd³/6 — with d = 12 inches, π × 1,728 ÷ 6 = 288π gives the same 904.78 cubic inches. Because the radius is cubed, measuring errors compound fast: overstating a 6 inch radius by half an inch overstates the volume by about 27%.

Why does a cone hold exactly one third of a cylinder?

A cone with the same base radius and height as a cylinder always holds exactly one third of its volume: V = (1/3)πr²h. For r = 3 inches and h = 8 inches, the cone holds (1/3) × π × 9 × 8 = 24π = 75.40 cubic inches — exactly a third of the matching cylinder's 72π = 226.19 cubic inches. The result is exact (first proved by Eudoxus and Archimedes using the method of exhaustion), and the same 1/3 factor applies to any pyramid against its matching prism: taper any solid from a full base to a point and it keeps one third of the prism's volume.

How do I find the volume of a cube or a rectangular box?

A cube is V = s³: a 4 inch cube holds 4³ = 64 cubic inches. A rectangular box (rectangular prism) is V = l × w × h: a 12 × 8 × 6 inch box holds 576 cubic inches, which is 576 ÷ 231 = 2.49 US gallons. The only rule is that all three dimensions must be in the same unit before you multiply — mixing feet and inches is the number-one source of wildly wrong answers. Measure everything in inches for gallons (÷ 231) or everything in centimeters for liters (÷ 1,000).

How many cubic inches are in a gallon?

Exactly 231. The US liquid gallon is defined by statute as 231 cubic inches — it is a definition, not a measurement, so the conversion carries zero rounding error. Useful relatives: a cubic foot is 1,728 cubic inches (7.48 gallons), and a cubic yard is 46,656 cubic inches (201.97 gallons). This calculator uses the exact 231 figure for every gallon conversion, which is why a 24 × 12 × 16 inch aquarium comes out at 4,608 ÷ 231 = 19.95 gallons on the nose.

How many liters are in a US gallon?

Exactly 3.785411784 liters. The figure looks rounded but is exact: a gallon is 231 cubic inches, an inch is defined as exactly 2.54 cm, so one gallon is 231 × 2.54³ = 231 × 16.387064 = 3,785.411784 cubic centimeters, and a liter is exactly 1,000 cm³. Going the other way, 1 liter ≈ 0.264172 US gallons. Don't confuse it with the imperial (UK) gallon, a larger unit fixed at exactly 4.54609 liters — about 20% bigger, which matters for fuel economy and recipe conversions.

How many gallons does my aquarium hold?

Multiply length × width × water height in inches and divide by 231. A 24 × 12 × 16 inch tank is 4,608 cubic inches ÷ 231 = 19.95 gallons — the footprint of a standard 20-gallon tank. Water weighs about 8.34 lb per gallon, so the water alone in that tank is roughly 166 lb before glass, stand, substrate and rock — check your furniture and floor can take it. For the true fill volume, use the inside dimensions and the actual waterline rather than the rim: glass thickness, substrate and headspace typically leave real capacity 10–15% below nominal.

How much concrete do I need for a slab?

Volume = slab area × thickness, with the thickness converted to feet, then divide cubic feet by 27 to get the cubic yards that ready-mix is sold in. A 10 × 10 ft slab poured 4 inches thick is 10 × 10 × (4 ÷ 12) = 33.33 cubic feet, and 33.33 ÷ 27 = 1.23 cubic yards. Order roughly 10% extra for spillage and an uneven subgrade — call it 1.4 yd³. For weight planning, normal concrete runs about 150 lb per cubic foot, so this small slab is about 5,000 lb of material.

How do I work out the gallons in a partly filled horizontal tank?

A horizontal cylindrical tank filled to depth d holds a circular segment of liquid: the filled cross-section area is A = r² × arccos((r − d) ÷ r) − (r − d) × √(2rd − d²), and volume = A × tank length. Example: a tank 48 inches in diameter (r = 24) and 72 inches long, filled to 12 inches: A = 576 × arccos(0.5) − 12 × √432 = 603.19 − 249.42 = 353.77 in², so V = 353.77 × 72 = 25,471 in³ ÷ 231 = 110.27 gallons of the tank's 564.02-gallon capacity. Note that 12 inches is 25% of the depth but only 19.6% of the volume — the tank narrows toward the bottom, so a dipstick reading is not proportional to gallons. The Advanced level of this calculator solves this for any tank.

How do you calculate the volume of a pyramid?

V = (1/3) × base area × height. For a rectangular base that is V = (1/3) × l × w × h: a pyramid over a 6 × 6 inch base standing 9 inches tall holds (1/3) × 36 × 9 = 108 cubic inches. Two things to watch: the formula works for any base shape (use the actual base area), and the height must be the perpendicular height from base to apex — not the slant height up a face, which is always longer and would overstate the volume. The 1/3 factor is the same one that makes a cone a third of its cylinder.

Where these figures come from

The formulas on this page are classical solid geometry — they don't change and carry no jurisdiction. The unit definitions behind the conversions (the 231-cubic-inch gallon, the 2.54 cm inch) are fixed by US and international standards bodies:

Last checked: July 2026. Mathematical formulas and unit definitions are stable; the water-weight and concrete-weight figures are practical approximations (water ≈ 8.34 lb/gal at room temperature, normal-weight concrete ≈ 150 lb/ft³) and vary slightly with temperature and mix.

Understanding your result

Select the question that matches where you are right now.

The headline number is the exact geometric volume of your shape in the unit you chose — and the breakdown restates it in gallons, liters, cubic feet and as a water weight, all from exact conversion factors.

What to do with it

Compare it against the thing you're buying or filling: gallons against a pump or pond liner, cubic yards against a concrete order, liters against a dosing bottle. The same volume, read in the trade's preferred unit.

What it is not

It's the geometric volume of the shape you described — not the usable capacity of a real container, which loses volume to wall thickness, fittings and headspace. Measure inside dimensions when capacity is the question.

Sanity anchors

Three exact numbers catch most blunders: 231 in³ = 1 US gallon, 1,728 in³ = 1 ft³ = 7.48 gallons, 1 L = 1,000 cm³. If your answer looks absurd, check it against these first.

Three things decide the number: which dimensions get squared or cubed, whether the solid tapers, and whether your units agree.

Powers punish errors

The radius appears squared in cylinders and cubed in spheres, so a small measuring slip compounds: 10% extra on a sphere's radius adds 33% to its volume. Measure the round dimensions most carefully.

Taper cuts to a third

A cone or pyramid holds exactly one third of the prism that shares its base and height — not roughly a third, exactly. If a tapered answer looks small, it isn't wrong; that's the geometry.

Units multiply three times

Volume scales with the cube of the unit: a foot is 12 inches but a cubic foot is 1,728 cubic inches. Mixing feet into an inches calculation doesn't nudge the answer — it wrecks it by three orders of magnitude. Keep every dimension in one unit and let the result unit do the converting.

The formula is exact — the measuring is where answers go wrong.

Halve the diameter

Tape measures read diameters; formulas want radii. Halve before you type — the r² and r³ terms turn a forgotten halving into a 4× or 8× error.

Measure inside, to the line

For anything that holds liquid, use inside dimensions and the real fill line, not the rim. Nominal container sizes typically overstate usable volume by 10–15%.

Add a working margin

Buying material against the number? Concrete gets ~10% extra for spillage; soil and mulch compress; tanks are never drained to zero. The exact volume is the floor of the order, not the order.

Volume feeds straight into mixing, scaling and cost questions — these tools pick up where this one stops.

Scale a mix or recipe

Turn one volume into another at the same ratio — batches, dilutions, feeds.

Proportion →
Split by ratio

Divide a total volume into parts — 3:1 sand to cement, 4:1 water to concentrate.

Ratio →
Fuel for the job

Gallons in the tank into miles and dollars for the trip.

Fuel cost →