To find the volume of a solid, measure its dimensions in one unit and use the formula for its shape: length × width × height for a box, πr²h for a cylinder, 4/3πr³ for a sphere, and one third of the matching prism for a cone or pyramid. The answer comes out in cubic units such as cm³ or ft³.
That is the whole method in two sentences. The rest of this guide gives you each formula with a worked example, shows how to turn cubic feet or cubic centimeters into gallons and liters, and lists the unit slips that cause most wrong answers. If you only need a number, the volume calculator handles 14 solids and converts the result for you.
What volume measures
Volume is the amount of three-dimensional space an object takes up or can hold. A shoebox, a fish tank, a gravel pile and a basketball all have a volume, and you find it the same way each time: measure the lengths the formula asks for, then multiply.
Because you multiply three lengths together, the unit is cubed. A box measured in inches gives cubic inches (in³). Measure in meters and you get cubic meters (m³). One cubic foot is the space inside a cube 1 foot on each side, and it holds 1,728 cubic inches, because 12 × 12 × 12 = 1,728. That cubing is the source of most unit mistakes, which we come back to near the end.
Capacity is volume expressed in liquid units: liters, milliliters, gallons, quarts. A liter is defined as exactly 1,000 cm³, so 1 mL equals 1 cm³. The US gallon is defined as exactly 231 in³. Those two facts let you move between solid geometry and the units on a bottle or a tank label.
Volume formulas at a glance
Here are the formulas for the seven solids people ask about most. In every row, r is the radius (half the diameter) and h is the perpendicular height, measured straight up from the base, not along a sloping side.
| Solid | Formula | What you measure |
|---|---|---|
| Cube | V = a³ | One edge, a |
| Rectangular prism (box) | V = l × w × h | Length, width, height |
| Cylinder | V = πr²h | Radius of the circular end, height |
| Sphere | V = 4/3 × πr³ | Radius |
| Cone | V = 1/3 × πr²h | Radius of the base, perpendicular height |
| Pyramid | V = 1/3 × base area × h | Base sides, perpendicular height |
| Triangular prism | V = 1/2 × b × t × l | Triangle base b, triangle height t, prism length l |
Notice the pattern. Every prism and cylinder is simply base area × height: a rectangle, a circle or a triangle stretched straight through space. Cones and pyramids taper to a point, and they always hold exactly one third of the prism or cylinder with the same base and height. If you can find the area of the base, you can find the volume of nearly any common solid. Our guide on how to find the area of flat shapes covers the base-area half of the job.
Prisms: cube, box and triangular prism
Cube
A cube has six identical square faces, so one measurement does the job: V = a³. A fabric storage cube that measures 13 inches on each side holds 13 × 13 × 13 = 2,197 in³. Divide by 231 to get gallons: 2,197 ÷ 231 = 9.51 US gallons. The cube calculator also gives the surface area and the diagonal if you need them.
Rectangular prism
Boxes, rooms, aquariums, raised beds and shipping cartons are rectangular prisms. Multiply the three edges: V = l × w × h.
Worked example: a raised garden bed is 8 ft long, 4 ft wide and 1 ft deep.
- Volume = 8 × 4 × 1 = 32 ft³.
- Soil is sold by the cubic yard, and 1 yd³ = 27 ft³, so 32 ÷ 27 = 1.19 yd³.
- Bagged soil usually comes in 1, 1.5 or 2 ft³ bags, so you would need 16 bags of 2 ft³, or about 18 to allow for settling.
For a metric fish tank of 60 × 30 × 36 cm, the volume is 64,800 cm³, which is 64.8 L because 1,000 cm³ makes 1 L. The rectangular prism calculator does both versions, and the cubic yard calculator is handy when you are ordering soil, mulch or gravel.
Triangular prism
A triangular prism is a triangle stretched along a length: tents, roof attics, wedge-shaped doorstops and Toblerone boxes. Find the triangle’s area (1/2 × base × height of the triangle), then multiply by the length of the prism.
Worked example: an attic under a simple gable roof is 24 ft wide at the floor, 6 ft high at the ridge and 40 ft long.
- Triangle area = 1/2 × 24 × 6 = 72 ft².
- Volume = 72 × 40 = 2,880 ft³, or about 81.6 m³.
That figure is what you would use to size attic ventilation or estimate loose-fill insulation for a given depth. The triangular prism calculator also works when you know the three sides of the triangle instead of its height.
Cylinder
A cylinder is a circle stretched to a height, so its volume is the circle’s area times the height: V = πr²h. Use the radius, which is half the diameter you usually measure across the top.
Worked example: a rain barrel is 22 inches across and 34 inches tall.
- Radius = 22 ÷ 2 = 11 in.
- Base area = π × 11² = π × 121 = 380.13 in².
- Volume = 380.13 × 34 = 12,924.5 in³.
- In gallons: 12,924.5 ÷ 231 = 55.95 US gallons. In liters: about 211.8 L.
That is why a drum this size is sold as a 55-gallon drum. Pipes, cans, columns, wells and round tanks all use the same formula. The cylinder calculator can also work backward from a volume to the height you need, which helps when you are sizing a tank to hold a set number of gallons.
Sphere and hemisphere
For a ball, V = 4/3 × πr³. Because the radius is cubed, small changes in size make a big difference. Double the diameter and the volume goes up eight times.
Worked example: an exercise ball is 65 cm in diameter, so r = 32.5 cm.
- r³ = 32.5 × 32.5 × 32.5 = 34,328.1 cm³.
- V = 4/3 × π × 34,328.1 = 143,793 cm³.
- That is 143.8 L, or about 38 US gallons of air.
A hemisphere (half a sphere, like a mixing bowl) is simply half of that: V = 2/3 × πr³. A bowl with a 10 cm inside radius holds 2/3 × π × 1,000 = 2,094 cm³, about 2.1 L. A useful fact for packing problems: a sphere fills π/6, or about 52.4%, of the smallest cube that contains it. The sphere calculator gives volume and surface area from any one measurement, including the circumference if a tape around the middle is all you have.
Cone and pyramid: the one-third rule
Cone
A cone holds one third of the cylinder with the same base and height: V = 1/3 × πr²h. The height must be the vertical height from the base to the tip, not the slant height along the side.
Worked example: a gravel pile is roughly a cone 10 ft across and 4 ft high.
- Radius = 10 ÷ 2 = 5 ft.
- V = 1/3 × π × 5² × 4 = 1/3 × π × 100 = 104.7 ft³.
- In cubic yards: 104.7 ÷ 27 = 3.88 yd³.
So the pile is close to 4 yards of material, which is a handy check before you pay for a delivery. The cone calculator also returns the slant height and surface area.
Pyramid
Any pyramid, square or rectangular or triangular, holds one third of its base area times its perpendicular height: V = 1/3 × B × h. For a square base of side a, that becomes V = a²h ÷ 3.
Worked example: the Great Pyramid of Giza had a square base about 230.3 m on each side and an original height of about 146.6 m. V = 230.3² × 146.6 ÷ 3 = 53,038 × 146.6 ÷ 3 ≈ 2.59 million m³. The pyramid volume calculator accepts square, rectangular and triangular bases.
Converting volume to gallons and liters
Once you have a volume in cubic units, converting to liquid units is a single multiplication. These factors come from the exact definitions published by NIST’s unit conversion resources: 1 inch is exactly 2.54 cm, and 1 US gallon is exactly 231 in³.
| From | US gallons | Liters |
|---|---|---|
| 1 in³ | 0.004329 | 0.016387 |
| 1 ft³ | 7.4805 | 28.317 |
| 1 yd³ | 201.97 | 764.55 |
| 1,000 cm³ | 0.26417 | 1 |
| 1 m³ | 264.17 | 1,000 |
So the 32 ft³ garden bed above would hold 32 × 7.4805 = 239.4 gallons of water, and the 2,880 ft³ attic would hold over 21,500 gallons. The cubic feet to gallons converter and the liters to gallons converter do these in one step, and the general volume converter covers everything from teaspoons to acre-feet.
One trap: the UK (imperial) gallon is 4.546 L, about 20% larger than the US gallon of 3.785 L. Recipes, fuel economy figures and pool sizes from the UK use the larger gallon, so check which one a source means.
Common unit mistakes
The formulas are simple. Nearly every wrong answer comes from the measurements going in.
- Mixing units. A box 3 ft long, 18 in wide and 10 in high must be converted first: 36 × 18 × 10 = 6,480 in³, or 3 × 1.5 × 0.833 = 3.75 ft³. Multiplying 3 × 18 × 10 gives nonsense.
- Converting cubic units with a linear factor. There are 12 inches in a foot but 1,728 cubic inches in a cubic foot, and 27 (not 3) cubic feet in a cubic yard. Likewise 1 m³ is 1,000,000 cm³, not 100.
- Using the diameter where the formula wants the radius. Plugging in the diameter makes a cylinder four times too big and a sphere eight times too big.
- Using the slant height for a cone or pyramid. The formula needs the vertical height. If you only have the slant height s and radius r, the height is √(s² − r²).
- Measuring the outside of a container when you want what it holds. Wall thickness matters: a tank with 2 cm walls loses noticeable capacity on every side.
- Forgetting that real objects are not perfect shapes. Piles slump, beds are not filled to the brim, and soil settles. Add 5–10% for materials you are buying.
How to find the volume of an irregular object
Some things, such as a rock, a sculpture or a car part, fit no formula. Two approaches work.
The first is water displacement. Fill a measuring container, note the level, submerge the object fully and read the new level. The rise is the object’s volume, and since 1 mL = 1 cm³, a rise of 240 mL means 240 cm³. This is the classic Archimedes method, and it is also how you get the volume you need for calculating density.
The second is to break the shape into simple solids. An L-shaped concrete step is two boxes. A silo is a cylinder with a cone or hemisphere on top. Find each piece’s volume and add them, or subtract when one shape is a hole in another, such as a pipe wall (outer cylinder minus inner cylinder). This is exactly how our guide to how much concrete you need handles footings and steps.
Frequently asked questions
What is the formula for volume?
There is no single formula; it depends on the shape. For prisms and cylinders it is base area × height, and for cones and pyramids it is one third of that. A sphere uses 4/3 × πr³.
How do I find the volume in gallons?
Work out the volume in cubic inches and divide by 231, or in cubic feet and multiply by 7.48. If you worked in liters, divide by 3.785 to get US gallons.
Is volume the same as capacity?
They measure the same thing. Volume usually refers to the space an object occupies, in cubic units, while capacity refers to how much a container holds, often in liters or gallons.
How many cubic feet are in a cubic yard?
27, because a cubic yard is 3 ft × 3 ft × 3 ft. To turn cubic feet into cubic yards, divide by 27.
Why is a cone one third of a cylinder?
Calculus proves it, but you can check it at home: three full cones of water exactly fill a cylinder with the same base and height. The same one-third relationship holds for any pyramid and its matching prism.
Do I measure inside or outside dimensions?
Measure inside dimensions for how much a container holds, and outside dimensions for how much space the object takes up, for example when fitting it in a car or on a shelf.
Volume problems get easy once you see that most solids are a base area multiplied by a height, with cones and pyramids taking one third. Measure carefully, keep every length in the same unit, use the radius rather than the diameter, and convert at the end. If you want to double-check a result, plug your numbers into the volume calculator and compare. The free OpenStax Prealgebra 2e textbook from Rice University is a good place to practice more problems.
