StatGardenREF. DESK
Calculators/Geometry/Rectangular prism & cube
Geometry

Rectangular prism & cube calculator

Volume, surface area and space diagonal of a box.

What this calculator does

A rectangular prism, a box, is set by three independent measurements, and its volume is simply their product. A cube is the special case where all three match, and this calculator handles it without any separate mode: enter the same value three times and every result is correct for a cube.

The space diagonal, the line from one corner straight through the interior to the opposite corner, is the measurement people most often get wrong, because it is not any single face’s diagonal. It requires all three dimensions combined by Pythagoras, applied twice.

The formula

FormulaV = lwh · A = 2(lw + lh + wh) · diagonal = √(l²+w²+h²)

The space diagonal follows from two applications of Pythagoras: first finding the diagonal across the base rectangle, then treating that diagonal and the height as the two legs of a second right triangle. The result, √(l² + w² + h²), is the greatest straight-line distance that fits inside the box: the figure that determines whether a long item like a piece of timber or a pole will fit diagonally when it will not fit straight.

TermMeaning
l, w, hLength, width and height: the three edge lengths.
VVolume, equal to l × w × h.
ATotal surface area across all six faces, equal to 2(lw + lh + wh).
Space diagonalCorner to opposite corner through the interior, equal to √(l² + w² + h²).

The inputs explained

FieldWhat to enter
LengthThe length of the box.
WidthThe width of the box.
HeightThe height of the box. Set equal to l and w for a cube.

When to use it

Whether something will fit inside a box or room

The space diagonal is the true maximum length that fits, corner to corner: useful for a pole, pipe or piece of furniture that will not fit lying flat along any single edge.

Volume for shipping, storage or packing

Volume from length, width and height is the standard figure for freight, storage capacity and container fill, and the litres conversion applies directly when measurements are in centimetres.

Material for a box, crate or cabinet

Total surface area across all six faces gives the sheet material needed to build or wrap a box, before allowing for joins, overlaps or waste.

Comparing a box to the cube of equal volume

Setting all three dimensions equal shows what a cube of matching volume would look like: often a useful reference point when a box’s proportions look unusually long or flat.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How volume and diagonal change with height, base fixed at 30 by 20

A fixed rectangular base while the height increases.

Base 30 × 20
HeightVolumeSpace diagonalTotal edge length
53,000.0036.401220.000
106,000.0037.417240.000
159,000.0039.051260.000
2012,000.0041.231280.000
3018,000.0046.904320.000
Volume rises in direct proportion to height here: from 3,000 at a height of 5 to 18,000 at a height of 30, exactly a sixfold increase for a sixfold height. The space diagonal grows far more slowly, since it depends on the height only through a square root.

A cube scaling up in size

All three dimensions increased together: the cube case.

Cube (all sides equal)
Side lengthVolumeSurface areaSpace diagonal
l=w=h=51,500.00950.00025.495
l=w=h=103,000.001,300.0026.926
l=w=h=154,500.001,650.0029.155
l=w=h=206,000.002,000.0032.016
l=w=h=309,000.002,700.0039.051
Doubling a cube’s side from 5 to 10 multiplies its volume by eight (125 to 1,000) but its surface area only by four (150 to 600): the same square-versus-cube gap that shows up in every solid shape, and the reason larger boxes are more material-efficient per unit of volume.

Questions

How is the space diagonal different from a face diagonal?

A face diagonal runs across one flat side of the box and uses only two of the three dimensions. The space diagonal runs through the interior from corner to opposite corner and uses all three, giving a longer measurement than any face diagonal.

How do I find the volume of a box?

Multiply length, width and height together. All three must be in the same unit, and the result is in that unit cubed.

Is a cube just a box with equal sides?

Yes exactly: a cube is the special case of a rectangular prism where length, width and height are all equal. Every formula here applies unchanged, just with matching inputs.

How do I convert a box’s volume to litres?

If all three dimensions are in centimetres, divide the volume in cubic centimetres by 1,000. This calculator performs that conversion for you when it applies.

Why does surface area grow more slowly than volume as a box scales up?

Surface area depends on the dimensions squared while volume depends on them cubed. Any uniform scale-up multiplies volume by a larger factor than surface area, which is why bigger containers hold proportionally more for their material.

For a shape that tapers to a point, see the pyramid calculator. For scaling effects in general, use the area and volume scaling calculator.