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
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.
| Term | Meaning |
|---|---|
| l, w, h | Length, width and height: the three edge lengths. |
| V | Volume, equal to l × w × h. |
| A | Total surface area across all six faces, equal to 2(lw + lh + wh). |
| Space diagonal | Corner to opposite corner through the interior, equal to √(l² + w² + h²). |
The inputs explained
| Field | What to enter |
|---|---|
| Length | The length of the box. |
| Width | The width of the box. |
| Height | The 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.
| Height | Volume | Space diagonal | Total edge length |
|---|---|---|---|
| 5 | 3,000.00 | 36.401 | 220.000 |
| 10 | 6,000.00 | 37.417 | 240.000 |
| 15 | 9,000.00 | 39.051 | 260.000 |
| 20 | 12,000.00 | 41.231 | 280.000 |
| 30 | 18,000.00 | 46.904 | 320.000 |
A cube scaling up in size
All three dimensions increased together: the cube case.
| Side length | Volume | Surface area | Space diagonal |
|---|---|---|---|
| l=w=h=5 | 1,500.00 | 950.000 | 25.495 |
| l=w=h=10 | 3,000.00 | 1,300.00 | 26.926 |
| l=w=h=15 | 4,500.00 | 1,650.00 | 29.155 |
| l=w=h=20 | 6,000.00 | 2,000.00 | 32.016 |
| l=w=h=30 | 9,000.00 | 2,700.00 | 39.051 |
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.