Logo

MonoCalc

/

Diagonal of Rectangular Prism Calculator

Geometry

Space Diagonal (d)

15.6205 cm

Bottom Face Diagonal (l × w)

14.4222 cm

Front Face Diagonal (l × h)

13.4164 cm

Side Face Diagonal (w × h)

10.0000 cm

Prism Diagram

l = 12.00 cmh = 6.00 cmw = 8.00 cmd = 15.62 cmbottom = 14.42 cmfront = 13.42 cmside = 10.00 cm

Compare Multiple Boxes

Box A (10.00 × 8.00 × 6.00 cm)

14.1421 cm

Longest space diagonal

Box B (12.00 × 5.00 × 5.00 cm)

13.9284 cm

About This Tool

Diagonal of Rectangular Prism Calculator – Space Diagonal Explained

A rectangular prism (also called a cuboid or rectangular box) has three distinct edge lengths — length, width, and height. Its space diagonal is the longest straight line that fits inside it: a line connecting two opposite vertices that passes straight through the solid's interior. This calculator finds the space diagonal along with the three face diagonals from a prism's dimensions, and can also reverse the process to solve for a missing dimension when the diagonal is already known. It's useful in packaging design, shipping, architecture, and geometry education whenever you need to know the longest object that will fit inside — or diagonally through — a box-shaped space.

The Space Diagonal Formula

The space diagonal is derived by applying the Pythagorean theorem twice. First, the diagonal across the base (length × width) is found:

d_bottom = √(l² + w²)

That base diagonal then becomes one leg of a second right triangle, with the prism's height as the other leg and the space diagonal as the hypotenuse, which simplifies to the familiar 3D Pythagorean formula:

d = √(d_bottom² + h²) = √(l² + w² + h²)

For example, a prism with length 12 cm, width 8 cm, and height 6 cm has a space diagonal of √(144 + 64 + 36) = √244 ≈ 15.6205 cm. Only Math.sqrt() is needed — no external library is required.

Face Diagonals

Alongside the space diagonal, the calculator reports all three face diagonals — one for each pair of dimensions:

d_bottom = √(l² + w²) — diagonal of the length × width face
d_front = √(l² + h²) — diagonal of the length × height face
d_side = √(w² + h²) — diagonal of the width × height face

Each face diagonal only crosses one flat rectangular face, so all three are shorter than the space diagonal, which cuts through the prism's interior to reach the farthest possible vertex.

Solving for a Missing Dimension

If you already know the space diagonal and two of the three dimensions, you can rearrange the formula to solve for the missing one:

h = √(d² − l² − w²)

For example, if a box needs a space diagonal of at least 20 cm to fit a rod diagonally, and the base is fixed at 15 cm × 10 cm, the required height is √(400 − 225 − 100) = √75 ≈ 8.6603 cm. This reverse mode is particularly useful for fit-check problems — determining how tall, wide, or long a box must be to fit an object of a known length.

When the diagonal is too short
If the target diagonal is not greater than √(l² + w²) of the two known sides, there is no valid positive height that satisfies the equation — the calculator will show a validation error explaining that the diagonal is too short for those dimensions.

Comparing Multiple Boxes

The comparison mode lets you enter two or more sets of dimensions and see their space diagonals side by side. This is helpful when choosing between several container or packaging options to fit the longest possible item, such as comparing a 10 × 8 × 6 box against a 12 × 5 × 5 box to see which one offers more diagonal clearance.

Unit Conversion

Enter dimensions in any supported unit — millimeters, centimeters, meters, inches, feet, or yards — and the calculator converts internally to a consistent base unit before computing the result, then displays the answer back in your chosen unit.

Common Applications

  • Packaging and shipping — determining the longest item that can fit diagonally inside a rectangular box or shipping container
  • Architecture and construction — checking clearances for rectangular rooms, ducts, or storage units
  • Furniture and moving — verifying whether a large object can be tilted diagonally through a doorway or hallway
  • 3D modeling and game design — computing bounding diagonals for collision detection and camera framing
  • Geometry education — demonstrating how the Pythagorean theorem extends from two dimensions into three

Precision and Accuracy

All calculations use standard 64-bit floating-point arithmetic (IEEE 754), accurate to about 15 significant digits. Displayed values are rounded to your chosen precision, from 0 to 10 decimal places.

Frequently Asked Questions

Is the Diagonal of Rectangular Prism Calculator free?

Yes, Diagonal of Rectangular Prism Calculator is totally free :)

Can I use the Diagonal of Rectangular Prism Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Diagonal of Rectangular Prism Calculator?

Yes, any data related to Diagonal of Rectangular Prism Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does this diagonal of rectangular prism calculator work?

Enter the length, width, and height of a rectangular prism (cuboid) to instantly get its space diagonal — the straight line through the interior connecting two opposite corners — along with the three face diagonals. You can also switch to reverse mode and enter two dimensions plus a target diagonal to solve for the missing third dimension.

What is the formula for the space diagonal of a rectangular prism?

The space diagonal is d = √(l² + w² + h²), where l, w, and h are the length, width, and height. This is the 3D extension of the Pythagorean theorem, applied first across a face and then through the interior to the opposite vertex.

What is the difference between a space diagonal and a face diagonal?

A face diagonal runs across one flat rectangular face of the prism, connecting two corners of that face. The space diagonal is longer and passes through the solid's interior, connecting two opposite vertices on different faces entirely.

How do I find a missing dimension if I know the diagonal?

If you know the space diagonal and two of the three dimensions, use the reverse/fit-check mode. It rearranges the formula to h = √(d² − l² − w²), which is useful for checking whether an object of a known length will fit diagonally inside a box.

Can I compare multiple boxes at once?

Yes. Comparison mode lets you enter two or more sets of dimensions and see their space diagonals side by side, which is helpful when choosing the most suitable container or shipping box for a long item.

How accurate are the results?

Calculations use standard 64-bit floating-point arithmetic (IEEE 754), accurate to about 15 significant digits. Displayed values are rounded to your chosen precision, from 0 to 10 decimal places.