Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Space Diagonal
13
units
Base face diagonal (√(l²+w²)) 5
Volume (l × w × h) 144

What Is the Diagonal of a Rectangular Prism?

A rectangular prism (also called a cuboid or box) has three dimensions: length (l), width (w), and height (h). The space diagonal is the straight line that runs from one corner of the box through its interior to the opposite corner. It is the longest straight segment that fits inside the prism. This calculator finds that diagonal instantly from the three side lengths.

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

How to Use the Calculator

Enter the length, width, and height of your box using the same unit (cm, inches, meters — anything works, as long as all three match). The calculator returns the space diagonal in those same units, plus the base face diagonal and the volume for convenience.

The Formula Explained

The space diagonal comes from applying the Pythagorean theorem twice. First, the diagonal of the base rectangle is \(\sqrt{l^2 + w^2}\). Then that base diagonal and the height form a right triangle, giving the full 3D diagonal:

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

It works because the three edges are mutually perpendicular, so their squared lengths simply add.

Advertisement
Two right triangles showing how the base diagonal combines with height to form the space diagonal
The base diagonal \(\sqrt{l^2+w^2}\) and the height \(h\) form a right triangle whose hypotenuse is the space diagonal \(d\).

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 longest object that could fit corner-to-corner inside the box is 13 units long.

FAQ

Does the order of l, w, and h matter? No. Because all three terms are squared and added, you can swap them freely and get the same diagonal.

What units does the answer use? The same unit you enter. Use consistent units for all three dimensions.

What is the difference between the face diagonal and the space diagonal? The face diagonal lies flat on one side of the box, while the space diagonal cuts through the interior and is always longer.

Last updated: