Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Space Diagonal
13
units
Face diagonal (l, w) 5
Volume 144
Surface area 192

What is the space diagonal of a rectangular prism?

A rectangular prism (also called a cuboid or box) is a 3D shape with six rectangular faces. The space diagonal is the longest straight line you can draw inside it, running from one corner to the corner directly opposite through the interior of the box. This calculator finds that diagonal instantly from the length, width, and height.

Rectangular prism with length, width, height and space diagonal marked
The space diagonal connects two opposite corners of the cuboid through its interior.

How to use the calculator

Enter the three edge lengths — length (\(l\)), width (\(w\)), and height (\(h\)) — in any consistent unit (cm, inches, metres, etc.). The calculator returns the space diagonal in the same unit, plus the length-width face diagonal, the volume, and the surface area for convenience.

The formula explained

The space diagonal comes from applying the Pythagorean theorem twice. First, the diagonal across the base is \(\sqrt{l^2 + w^2}\). That base diagonal and the height form a right triangle, so the full space diagonal is:

$$d = \sqrt{l^2 + w^2 + h^2}$$

Because all three terms are squared and added, the order of \(l\), \(w\), and \(h\) does not change the result.

Advertisement
Two right triangles showing base diagonal then space diagonal derivation
The base diagonal combines with the height in a second right triangle to give the space diagonal.

Worked example

Suppose a box measures \(l = 3\), \(w = 4\), and \(h = 12\). Then $$d = \sqrt{3^2 + 4^2 + 12^2} = \sqrt{9 + 16 + 144} = \sqrt{169} = 13.$$ So the space diagonal is exactly 13 units — the longest object that fits straight across the inside of the box.

FAQ

Does the diagonal depend on which edge is the height? No. Swapping \(l\), \(w\), and \(h\) gives the same diagonal because they are all squared and summed.

What units does it use? Any unit, as long as \(l\), \(w\), and \(h\) share it. The diagonal comes out in that same unit.

How is the space diagonal different from a face diagonal? A face diagonal crosses just one flat rectangular side (2D), while the space diagonal passes through the interior of the solid (3D) and is always longer.

Last updated: