Rectangular Prism Volume and Surface Area Calculator

Enter length, width and height and this calculator returns the volume of the box, its capacity in gallons, litres, cubic metres, cubic yards or barrels, the total surface area, the footprint, the area of the four vertical sides, and the space diagonal — the longest straight object that fits inside. A face-by-face breakdown shows which pair of sides contributes what to the surface area, which is what you need when you are costing cardboard, sheet metal, formwork or insulation rather than contents. Every figure comes from three multiplications, and the calculator shows each one.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
LengthThe longest horizontal dimension of the box, measured on the inside if you want capacity.4 ft
WidthThe other horizontal dimension, perpendicular to the length.3 ft
HeightThe vertical dimension, or the depth of an excavation.2 ft
Report capacity inChoose the working unit for the contents; volume itself is always reported in cubic feet.US gallons

It returns

  • Volume — Length times width times height.
  • Capacity
  • Total surface area — All six faces, which is the material a closed box needs.
  • Space diagonal — Corner to opposite corner through the interior — the longest rigid object the box can hold.
  • Footprint area
  • Area of the four sides — Perimeter times height, excluding the top and bottom.

The formula

V=lwh
Asides=2(l+w)h

In plain text: V = l × w × h; A = 2(lw + lh + wh); D = √(l² + w² + h²)

  • lLength of the box (ft)
  • wWidth of the box (ft)
  • hHeight of the box (ft)
  • DSpace diagonal, corner to opposite corner through the interior (ft)

A rectangular prism, or cuboid, has three pairs of identical rectangular faces meeting at right angles. All three formulas are symmetric in l, w and h, so it does not matter which dimension you call which.

Updated Category 3D Solids: Volume & Surface Area Verified against published test cases Reading time 9 min

Three numbers, three answers

A rectangular prism — a cuboid, or in plain language a box — is the simplest solid in Euclidean geometry: three lengths meeting at right angles, and everything about it follows from those three. The volume is the product l × w × h, which you can read as taking the footprint area l × w and stacking it h units deep. Because multiplication commutes, it does not matter which dimension you call length: 4 × 3 × 2 and 2 × 4 × 3 both give 24.

Surface area is less symmetric in feel but just as simple. The box has three pairs of identical faces: top and bottom, each l × w; front and back, each l × h; two ends, each w × h. Doubling and adding gives A = 2(lw + lh + wh). Splitting it that way is what the breakdown table does, and it matters in practice because the pairs are often priced or specified differently — a shipping carton's top flap is not the same problem as its side panel.

The space diagonal comes from the Pythagorean theorem applied twice. First across the base: that diagonal is √(l² + w²). Then up to the far top corner, using that base diagonal and the height as legs: D = √(l² + w² + h²). For a 4 × 3 × 2 box, that is √(16 + 9 + 4) = √29 = 5.385.

Why shape changes the material cost but not the capacity

Volume depends only on the product of the three dimensions, but surface area depends on their arrangement, and that difference is where money lives. Compare three boxes each holding 64 cubic feet. A 4 × 4 × 4 cube has surface area 2(16 + 16 + 16) = 96 ft². An 8 × 4 × 2 box holds the same 64 but needs 2(32 + 16 + 8) = 112 ft². A 16 × 4 × 1 box holds 64 as well and needs 2(64 + 16 + 4) = 168 ft².

So the long, thin box uses 75% more material than the cube for exactly the same contents. Among all rectangular boxes of a given volume, the cube minimises surface area, which is the geometric fact behind almost every packaging decision. Run the numbers with the cube calculator to see the best case for any target volume.

The same arithmetic works in reverse for heat loss, since heat escapes through surface while the thing being kept warm occupies volume. A compact rectangular building loses less heat than a sprawling one of the same floor area, and a chest freezer loses less than an upright of the same capacity. Surface area, not volume, is the quantity to minimise whenever the boundary is what costs you.

Worked example: a 10 × 8 × 5 foot excavation

You are digging a rectangular pit 10 feet long, 8 feet wide and 5 feet deep. Find the spoil volume in cubic yards, the area of formwork for the walls, and whether a 13-foot pipe will fit inside.

  1. Find the footprint. 10 × 8 = 80 ft².
  2. Multiply by depth. 80 × 5 = 400 ft³ of excavation.
  3. Convert to cubic yards. 400 ÷ 27 = 14.815 yd³. Order 15 yards of truck capacity and expect the loose spoil to measure more than that once it is dug, because broken ground swells.
  4. Find the wall area. Perimeter is 2(10 + 8) = 36 ft, so the four walls are 36 × 5 = 180 ft² of formwork or shoring.
  5. Find the total surface area. 2(80 + 50 + 40) = 340 ft², which is the walls plus the base plus a lid if there were one.
  6. Check the diagonal. D = √(100 + 64 + 25) = √189 = 13.75 ft, so a 13-foot pipe does fit corner to corner, with 9 inches to spare.

Note how differently the three answers behave. The volume needed all three dimensions multiplied; the wall area needed only the perimeter and the depth; the diagonal needed the squares. Getting one right does not mean you have the others, which is why a takeoff sheet lists them separately.

Which number you actually need

Use volume when you are buying or moving contents: concrete, soil, water, grain, freight. Use the capacity output to convert it into the unit your supplier quotes — cubic yards for aggregate and concrete, gallons or litres for liquids, cubic metres for international freight.

Use total surface area when you are buying the boundary: cardboard, sheet metal, plywood, paint, insulation, wrap. If the box is open-topped, subtract one footprint area from the total; if it is open at both ends, use the four-sides figure instead, which this calculator reports separately.

Use the space diagonal for fit questions. It is the longest straight rigid line that fits inside the box, and it is always longer than any single edge. But treat it as an upper bound rather than a promise: an object exactly that long only fits along one precise line and only if it has no thickness. Anything with real cross-section needs meaningful clearance below the diagonal figure.

Same volume, different shapes: the cost of being long and thin

Every row holds exactly 64 cubic feet. Surface area is 2(lw + lh + wh) and the diagonal is √(l² + w² + h²), both evaluated at the stated dimensions.
Dimensions (ft)Volume (ft³)Surface area (ft²)Extra material vs the cubeSpace diagonal (ft)
4 × 4 × 46496.000%6.928
8 × 4 × 264112.0016.7%9.165
8 × 8 × 164160.0066.7%11.358
16 × 4 × 164168.0075.0%16.523
16 × 2 × 264136.0041.7%16.248
32 × 2 × 164196.00104.2%32.078

The cube is the least-material rectangular box for any given volume. Each percentage is (area − 96) ÷ 96 for that row.

Assumptions and common errors

  • Internal versus external dimensions. Capacity comes from internal measurements; material area comes from external ones. On a thick-walled box the two differ enough to matter.
  • Cubing a linear conversion. A cubic yard is 27 cubic feet, not 3, and a cubic foot is 1,728 cubic inches, not 12. Convert lengths first, then multiply.
  • Bulking of excavated material. A 400 ft³ hole yields more than 400 ft³ of loose spoil, because broken ground occupies more space than it did in place. Ask your supplier for the swell factor of the material.
  • Assuming the diagonal guarantees a fit. The space diagonal is the theoretical maximum for a zero-thickness line. Real objects need clearance and a route in through an opening.
  • Forgetting that surface area is not symmetric. Two boxes with the same volume can differ in material by 75% or more, as the table above shows. Never estimate material from volume alone.

Key terms

Cuboid
The formal name for a rectangular prism: six rectangular faces meeting at right angles, in three identical pairs.
Footprint area
The area of the base, l × w. It is what a box occupies on a floor or a pallet, and it drives storage cost.
Space diagonal
The distance from one corner to the opposite corner through the interior, √(l² + w² + h²). It is the longest straight line inside the box.

When to reach for a different shape

If all three dimensions are equal, the box is a cube and the cube calculator lets you solve backwards from any single property. If the cross-section is round rather than rectangular, use the cylinder volume calculator. If the cross-section is a triangle — a gable roof space, a wedge, a swale — the triangular prism volume calculator is the right tool.

A tapered container is not a prism at all. Bins, buckets and hoppers narrow toward the bottom, and their volume follows the frustum formula rather than l × w × h. Treating a tapered bin as a box overstates its capacity, sometimes by a third or more.

For flat work — slab area, wall paint, floor covering — you often want the two-dimensional answer rather than the three-dimensional one. The rectangle area and perimeter calculator gives you that directly, and the perimeter it reports is the same figure this page uses to compute the area of the four sides.

Frequently asked questions

What is the formula for the volume of a rectangular prism?

V = length × width × height. All three dimensions must be in the same unit, and the answer comes out in that unit cubed. A box 4 ft × 3 ft × 2 ft holds 24 cubic feet. Because multiplication commutes, it makes no difference which dimension you label as length.

How do I find the surface area of a box?

A = 2(lw + lh + wh). The box has three pairs of identical faces, so compute the area of one face from each pair, add them, and double. For 4 × 3 × 2 that is 2(12 + 8 + 6) = 52 square feet. If the box is open-topped, subtract one l × w face from that total.

What is the diagonal of a rectangular box?

D = √(l² + w² + h²), the Pythagorean theorem applied in three dimensions. For a 10 × 8 × 5 foot pit that is √189 = 13.75 feet. This is the longest straight line that fits inside, so it sets the upper limit on the length of a rigid object the box can hold.

How many cubic yards is my excavation?

Multiply length by width by depth in feet, then divide by 27. A pit 10 × 8 × 5 feet is 400 cubic feet, which is 14.815 cubic yards. Remember that excavated material bulks up when it is broken, so the volume of spoil you have to cart away exceeds the volume of the hole.

Does the shape of a box change how much material it needs?

Yes, substantially. Three boxes each holding 64 cubic feet need 96, 112 and 168 square feet of material at 4 × 4 × 4, 8 × 4 × 2 and 16 × 4 × 1 respectively. The cube is always the least-material rectangular box for a given volume, which is why packaging designers push toward cubic proportions.

How do I convert cubic feet to gallons?

Multiply by 7.480519, since a US gallon is 231 cubic inches and a cubic foot is 1,728 cubic inches. A 24-cubic-foot box holds 179.5 US gallons. For litres, multiply cubic feet by 28.316847; for cubic metres, by 0.028316847. Select your unit in the capacity dropdown and the calculator applies the factor.

Should I use internal or external dimensions?

Internal for capacity, external for material. A crate with 1-inch walls measuring 48 × 40 × 36 inches outside has an internal volume based on 46 × 38 × 34. That is 59,432 cubic inches against 69,120 outside, 14% smaller. Freight dimensional weight, on the other hand, is always assessed on the outside measurements.

What is the difference between a cuboid and a cube?

A cube is the special case of a cuboid in which all three dimensions are equal. Every cube is a rectangular prism; most rectangular prisms are not cubes. The formulas on this page reduce to the cube formulas when l = w = h: the volume becomes a³ and the surface area becomes 6a².

References