Worked example: Volume Calculator
Box (legacy unitless inputs). This fixed reference example shows one complete scenario; the interactive results above use your current inputs.
View the example inputs
- Solid shape
- Rectangular box / tank
- Length (l)
- 3 units
- Unit for primary length / radius / edge
- Unspecified
- Width (w)
- 4 units
- Unit for second length / radius
- Unspecified
- Perpendicular height (h)
- 5 units
- Unit for height / third semi-axis / length
- Unspecified
| Calculated quantity | Example result |
|---|---|
| Volume | 60 cubic units |
| Total surface area | 94 square units |
Volume calculator: understand the shape before using the formula
How do I calculate the volume of a container?
Start with the space you want to measure. A rectangular aquarium, a cylindrical barrel and a round ball require different formulas. Choose the matching solid in this volume calculator, then use the dimension diagram to identify the required lengths. The result describes three-dimensional space; it is not a weight, a surface coverage or a count of items that will fit.
For full liquid capacity, measure the inside of the container. A tank 100 cm long, 500 mm wide and 0.4 m high has internal dimensions of 1 × 0.5 × 0.4 meters, giving 0.2 m³ or 200 liters. A real working fill line below the rim reduces usable capacity. This tool calculates full ideal shapes rather than partial liquid levels, wall thickness or safety allowances.
Rectangular box volume: length × width × height
How many cubic feet are in a box? Multiply its three perpendicular inside dimensions after putting them in compatible units. A 3 ft × 4 ft × 5 ft box contains 60 ft³. A cube is the special case where all three lengths are equal: an edge of 2 ft gives 2³ = 8 ft³.
A cubic-foot result counts cubes one foot long on each side. It does not mean 60 feet of edge length. For packaging, an object can have a smaller volume and still fail to fit through the opening or between the walls. Compare its dimensions and orientation as well as its volume.
Sphere volume: should I enter radius or diameter?
The sphere formula is V = 4πr³/3. The radius r runs from the center to the surface; the diameter spans the whole sphere and equals 2r. For a ball 20 cm across, enter a radius of 10 cm. Its volume is about 4,188.790205 cm³, equivalent to 4.188790205 liters.
Entering the full diameter as the radius multiplies the result by eight, because radius is cubed. The diagram marks a center-to-surface line to make that distinction visible. A sphere models an ideal round solid or cavity; a hollow spherical shell needs the inner volume subtracted from the outer volume.
Cylinder volume and cone volume: the same base, different capacity
A right circular cylinder has V = πr²h. Its two circular bases are parallel and h is the perpendicular distance between them. A cylinder with radius 2 cm and height 3 cm contains 12π cm³, about 37.699112 mL. Diameter must first be divided by two.
A cone with that same circular base and perpendicular height contains one third as much: V = πr²h/3. Its sloped side is not h. This difference matters when comparing a cylindrical container with a tapered funnel: matching their height and opening does not give them the same capacity.
Capsule volume: does height include the rounded ends?
A geometric capsule combines a cylinder with two hemispherical ends. Those ends together make one sphere, so V = πr²h + 4πr³/3. In this calculator h means only the straight cylindrical middle. The full end-to-end length is h + 2r, as the diagram’s construction lines show.
If the overall length is 6 cm and the radius is 1.5 cm, enter h = 6 − 3 = 3 cm. The volume is 11.25π cm³, about 35.342917 mL. Entering 6 as the middle length would count an extra cylinder. A rounded capsule is also not an ellipsoid; their profiles and formulas differ.
Spherical cap volume: why can the same radii give two answers?
A spherical cap is the part of a sphere on one side of a flat cut. R is the original sphere radius, r is the cut’s circular base radius, and h is the cap height measured from the cut plane to the spherical tip. With R and h known, V = πh²(R − h/3). The height must be between zero and 2R.
The form offers all three useful pairs. Given r and h, it derives R = (r² + h²)/(2h), with h greater than zero. Given R and r, the possible heights are R − √(R² − r²) and R + √(R² − r²). Choose the minor or major cap explicitly. R = 5 and r = 3 give heights 1 and 9, with very different volumes: about 14.660766 and 508.938010 cubic units.
When r = R, both choices describe a hemisphere and give the same answer. At h = 2R the cap is a full sphere. The solved-dimensions table shows the radius and height actually used; the diagram highlights the smaller or larger portion as appropriate.
Conical frustum volume for a tapered bucket or container
A conical frustum is a cone with its tip removed by a cut parallel to the base. Measure the two circular radii, R and r, and the perpendicular height h between their planes. The formula V = πh(R² + Rr + r²)/3 includes the changing cross-section; multiplying the top area by height would treat the container as a cylinder.
With bottom radius 3 cm, top radius 1 cm and height 4 cm, the volume is 52π/3 cm³, about 54.454273 mL. Swapping the top and bottom radii leaves the volume unchanged. Equal radii reduce the formula to a cylinder; a zero top radius reduces it to a cone.
Ellipsoid volume: full axes versus semi-axes
An ellipsoid stretches a sphere along three perpendicular directions. The formula V = 4πabc/3 uses semi-axes: a, b and c each measure from the center to the surface. If a cavity measures 3 cm × 4 cm × 10 cm across its full axes, enter 1.5, 2 and 5 cm. Its volume is 20π cm³, about 62.831853 mL.
Using all three full axes as semi-axes makes the volume eight times too large. The center-to-surface arrows on the illustration help prevent that mistake. Setting all semi-axes equal gives a sphere. The tool calculates ellipsoid volume without presenting an approximate ellipsoid surface area as an exact result.
Square pyramid volume: use the vertical height
The square pyramid formula is V = a²h/3. Here a is one base edge and h is the perpendicular distance from the base plane to the apex. A base edge of 5 ft and height of 12 ft give 25 × 12 ÷ 3 = 100 ft³. A slant height measured along a triangular face is a different length.
The volume uses a square base. A pyramid with a rectangular or other polygonal base would need that base’s area instead. The displayed total surface area additionally assumes a right square pyramid, with the apex directly over the base center.
Tube volume: wall material or the space inside the pipe?
These are different quantities. The main tube result is wall material volume: V = π(D² − d²)L/4, where D is the outer diameter, d is the inner diameter and L is the tube length. The inner diameter cannot exceed the outer diameter. A 3 ft outer diameter, 2.5 ft inner diameter and 10 ft length give about 21.598449 ft³ of wall material.
The separate internal bore capacity is πd²L/4, about 49.087385 ft³ in that example. Wall material plus bore capacity equals the outer cylinder envelope, about 70.685835 ft³. Use the bore result for how much an unobstructed pipe can contain, and the wall result for its ideal solid material volume. Neither establishes flow rate, pressure rating or mass without additional information.
How do I convert cubic units to liters or gallons?
A length conversion must be cubed when it converts a volume. One meter equals 100 centimeters, so 1 m³ = 100³ cm³ = 1,000,000 cm³. Because 1 cm³ = 1 mL, this is 1,000 liters. A 10 cm cube holds one liter, not ten liters. The live conversion table shows the same calculated physical volume in several units.
Select each dimension’s unit to combine measurements such as feet and inches or centimeters and millimeters. The first physical unit chosen in the form assigns that unit to all unspecified dimensions; later unit changes convert the existing measurement. You can then replace the number to enter another measurement. The main cubic-unit result follows the first dimension’s selected unit. Leaving every unit unspecified preserves a unitless geometry calculation but cannot establish liters or gallons.
A US liquid gallon is exactly 231 cubic inches, or 3.785411784 liters. An Imperial gallon is 4.54609 liters. The conversion table names both conventions and uses US liquid pints and quarts; it does not silently treat an unlabeled gallon as universal.
Why do surface area and volume change at different rates?
Surface area measures a boundary in square units; volume measures enclosed space in cubic units. Doubling every linear dimension multiplies surface area by four and volume by eight. Doubling only a cylinder’s height doubles its volume, while doubling only its radius multiplies volume by four. Stating which dimensions change makes a comparison reproducible.
The total surface areas here include closed bases, and a cap includes its flat circular base. An open tank, an unpainted underside or a tube’s exposed surfaces may require a different coverage calculation. For a composite solid, add separate non-overlapping volumes or subtract a cavity. Do not add overlapping pieces twice, and do not convert a volume to material weight without an appropriate density.
Volume formulas and worked shape examples
Ideal shapes. Capsule height excludes its ends; ellipsoid lengths are semi-axes. The tube example measures wall material.
| Solid | Volume formula | Example lengths in one unit | Volume (cubic units) |
|---|---|---|---|
| Rectangular box / tank | V = l × w × h | l = 3, w = 4, h = 5 | 60 |
| Sphere | V = 4πr³ / 3 | r = 1 | 4.1887902 |
| Cylinder | V = πr²h | r = 2, h = 3 | 37.69911184 |
| Cone | V = πr²h / 3 | r = 3, h = 4 | 37.69911184 |
| Cube | V = a³ | a = 2 | 8 |
| Capsule | V = πr²h + 4πr³ / 3 | r = 1.5, cylinder h = 3 | 35.34291735 |
| Spherical cap | V = πh²(R − h / 3) | R = 5, h = 1 | 14.66076572 |
| Conical frustum | V = πh(R² + Rr + r²) / 3 | R = 3, r = 1, h = 4 | 54.45427266 |
| Ellipsoid | V = 4πabc / 3 | semi-axes 1.5, 2, 5 | 62.83185307 |
| Square pyramid | V = a²h / 3 | a = 5, h = 12 | 100 |
| Tube / hollow cylinder | V = π(D² − d²)L / 4 | D = 3, d = 2.5, L = 10 | 21.59844949 |
| Rectangular box / tank | V = l × w × h | l = 3, w = 4, h = 5 | 60 |
| Sphere | V = 4πr³ / 3 | r = 1 | 4.1887902 |
| Cylinder | V = πr²h | r = 2, h = 3 | 37.69911184 |
| Cone | V = πr²h / 3 | r = 3, h = 4 | 37.69911184 |
| Cube | V = a³ | a = 2 | 8 |
| Capsule | V = πr²h + 4πr³ / 3 | r = 1.5, cylinder h = 3 | 35.34291735 |
| Spherical cap | V = πh²(R − h / 3) | R = 5, h = 1 | 14.66076572 |
| Conical frustum | V = πh(R² + Rr + r²) / 3 | R = 3, r = 1, h = 4 | 54.45427266 |
| Ellipsoid | V = 4πabc / 3 | semi-axes 1.5, 2, 5 | 62.83185307 |
| Square pyramid | V = a²h / 3 | a = 5, h = 12 | 100 |
| Tube / hollow cylinder | V = π(D² − d²)L / 4 | D = 3, d = 2.5, L = 10 | 21.59844949 |
Common volume units: cubic meters and liters
Factors use defined SI and customary length/liquid-volume relationships. Display rounding does not change the stored conversion factor. US liquid and Imperial units are explicitly distinguished. Source: NIST SI conversion factors.
| One unit | Cubic meters | Liters |
|---|---|---|
| Cubic millimeter | 0.000000001 | 0.000001 |
| Cubic centimeter / milliliter | 0.000001 | 0.001 |
| Liter | 0.001 | 1 |
| Cubic inch | 0.000016387064 | 0.016387064 |
| Cubic foot | 0.028316846592 | 28.316846592 |
| Cubic yard | 0.764554857984 | 764.554857984 |
| US liquid pint | 0.000473176473 | 0.473176473 |
| US liquid quart | 0.000946352946 | 0.946352946 |
| US liquid gallon | 0.003785411784 | 3.785411784 |
| Imperial gallon | 0.00454609 | 4.54609 |
| Cubic meter | 1 | 1,000 |
| Cubic millimeter | 0.000000001 | 0.000001 |
| Cubic centimeter / milliliter | 0.000001 | 0.001 |
| Liter | 0.001 | 1 |
| Cubic inch | 0.000016387064 | 0.016387064 |
| Cubic foot | 0.028316846592 | 28.316846592 |
| Cubic yard | 0.764554857984 | 764.554857984 |
| US liquid pint | 0.000473176473 | 0.473176473 |
| US liquid quart | 0.000946352946 | 0.946352946 |
| US liquid gallon | 0.003785411784 | 3.785411784 |
| Imperial gallon | 0.00454609 | 4.54609 |
| Cubic meter | 1 | 1,000 |
Formula and calculation method
Rectangular box / tank: V = l × w × h.
Sphere: V = 4πr³ / 3.
Cylinder: V = πr²h.
Cone: V = πr²h / 3.
Cube: V = a³.
Capsule: V = πr²h + 4πr³ / 3.
Spherical cap: V = πh²(R − h / 3).
Conical frustum: V = πh(R² + Rr + r²) / 3.
Ellipsoid: V = 4πabc / 3.
Square pyramid: V = a²h / 3.
Tube / hollow cylinder: V = π(D² − d²)L / 4.
Radius r is half the diameter; ellipsoid a, b and c are semi-axes. Capsule h is the cylindrical middle, excluding hemispherical ends. Tube D and d are diameters; its main volume is wall material.
Spherical cap: R²=(R−h)²+r². Given two radii, h=R±√(R²−r²); choose minor or major cap. Cap total surface area includes its flat base.
Mixed length units are converted to meters before physical volumes are calculated. One liter is 0.001 m³; one US liquid gallon is 231 cubic inches; one Imperial gallon is 4.54609 liters.
Scope and Limitations
- Ideal shapes only. A box/tank capacity requires inside dimensions and full filling; wall thickness, partial fill, packing, waste and material density are not inferred.
- Ellipsoid volume uses semi-axes; ellipsoid surface area is deliberately not estimated. Other total surface areas describe closed geometric boundaries, not a coating/order allowance.
- Unspecified units preserve existing unitless calculations and shared a/b/height inputs. Physical conversions require a unit for every active dimension. Numbers use floating-point arithmetic; displays are rounded and CSV contains calculated numeric values.
Reference Sources
- NIST: SI units of volume
- NIST: Conversion factors
- Wolfram MathWorld: Spherical cap
- Wolfram MathWorld: Ellipsoid
Frequently asked questions
How do I calculate volume from length, width and height?
For a rectangular box, multiply the three perpendicular dimensions: V = length × width × height. Use inside dimensions for full container capacity. Other shapes require their own formulas.
Can this volume calculator combine feet and inches?
Yes. Select a length unit for each active dimension. The tool converts physical lengths before calculating volume. The first physical unit selection assigns that unit to unspecified dimensions; later unit changes preserve the entered physical measurement.
How many liters are in one cubic meter?
One cubic meter is exactly 1,000 liters. One liter is one cubic decimeter, and one milliliter is one cubic centimeter.
Do I enter the radius or diameter?
Use radius for a sphere, cylinder, cone, capsule and frustum, as labeled. The tube inputs use full diameters. Ellipsoid inputs use center-to-surface semi-axes. Follow the diagram for the selected solid.
Does capsule height include the rounded ends?
No. Enter only the cylindrical middle length h. Subtract twice the radius from an overall capsule length to obtain h.
Why are there two spherical cap solutions?
A sphere radius and a smaller circular base radius can describe a minor cap or a major cap. Select the intended portion. At a hemisphere the two solutions coincide.
Does tube volume mean pipe capacity?
The main tube result measures wall material. Internal bore capacity is shown separately. Together they equal the outer cylinder volume.
Can I calculate a partially filled tank or material weight?
This calculator gives the full volume of an ideal solid or cavity. It does not model partial fill levels, packing, wall thickness, density, waste or construction allowances.