Key Points
- Space (body) diagonal: . A cuboid has 4, all the same length.
- Face diagonal: uses two edges only, for example . A cuboid has 12.
- Derivation: floor diagonal , then .
- Cube with edge : face diagonal , space diagonal .
- The space diagonal is the longest straight line that fits inside the box.
The Longest Thing That Fits in a Box
A box 40 cm long, 30 cm wide and 120 cm tall can hold a 130 cm rod, longer than any edge. Tilted from a bottom corner to the opposite top corner, it slides in with nothing to spare.
- The line the rod lies along is the diagonal of the cuboid.
- Its length depends only on the box's three measurements.
- The maths is the Pythagoras theorem, used twice.

What Is the Diagonal of a Cuboid?
The diagonal of a cuboid usually means its space diagonal (or body diagonal): the straight line joining two corners that do not share a face.
- A cuboid (or rectangular prism) is a box with 6 rectangular faces, 12 edges and 8 corners: a brick, a matchbox, a room.
- Its space diagonal passes through the inside of the box, across all three dimensions at once.
- That makes it the longest straight line the cuboid holds. The derivation below shows where the formula comes from.
Labels used on this page and in the tool:
- = length, = width, = height;
- = the diagonal of the floor (the bottom face);
- = the space diagonal.
Many textbooks write , , instead: is the same formula.
What Are the Two Types of Diagonals in a Cuboid?
A cuboid holds two kinds of diagonal, and telling them apart is the first real step.
- Face diagonal: joins opposite corners of one face and lies flat on it. It is just the diagonal of a rectangle. There are 12.
- Space diagonal: joins corners that share no face and runs through the inside. There are 4, all equal.
| Face diagonal | Space diagonal | |
|---|---|---|
| Joins | opposite corners of one face | opposite corners of the whole box |
| Lies | flat on the surface | through the inside |
| Uses | two edges | all three edges |
| Length | , or | |
| How many | 12 (two on each of 6 faces) | 4 |

A face diagonal knows only one flat rectangle; the space diagonal knows the whole box, which is why the rod depends on it.
How Do You Derive the Diagonal of a Cuboid Formula?
The formula comes from the Pythagoras theorem twice: in a right triangle, the longest side (the hypotenuse) squared equals the sum of the other two sides squared.
Step 1: across the floor
The floor is a rectangle with sides and . Its diagonal is the hypotenuse:
Step 2: from the floor up to the far corner
- From the end of , the vertical edge rises at a right angle to the floor, so also to .
- That makes an upright right triangle with legs and and hypotenuse :
Step 3: substitute and finish
Replace with :
| Symbol | Meaning | Units |
|---|---|---|
| Length of the space diagonal | cm, m (length units) | |
| Length of the cuboid | cm, m | |
| Width (breadth) of the cuboid | cm, m | |
| Height of the cuboid | cm, m |
For a 4 by 3 by 12 box: and . It climbs at about to the floor, since .

Does it matter which face you start from?
No. Go up the front wall first and then across, or any other route: every one gives . A second route is a handy check.
A second way: the 3D distance formula
- Put one corner at with the edges along the axes. The opposite corner is .
- The distance between two points in space is
- From to that is exactly .
- The flat version, the distance between two points on a grid, has one fewer square.

Try It Yourself
In the tool, move the sliders for , and . The orange dashed line is the floor diagonal and the green line is . Make tiny and watch shrink to .
Properties of the Space Diagonals
The four space diagonals share some neat facts.
- All four are the same length: each crosses the full length, width and height once.
- They all cross at the centre and cut each other in half there, because the box is symmetric about its centre.

- It is the longest straight line inside the box. Two points in the box differ by at most , and along each direction, so they are at most apart.
- It beats every edge and face diagonal: a third positive square under the root always adds length.
- For a long, thin box, only just. A 1 by 1 by 10 box has , just 1% more than its longest edge.
- In a cube, is times the edge, the biggest gain any box gives.
Edge cases worth checking
- A flat box: let shrink to 0 and the formula becomes ; let shrink too and it is just , a line segment.
- A cube with edge : face diagonal , space diagonal , the same pattern as the diagonal of a square. It always rises at about .
Examples of the Diagonal of a Cuboid
The examples move from a cube to a real packing decision and a backwards problem. Surds stay exact; decimals are rounded to two places.
Example 1
Find the face diagonal and the space diagonal of a cube with edge 5 cm.
- Face diagonal: cm.
- Space diagonal: cm.

Final answer: cm and cm.
Example 2
A box measures 6 cm by 8 cm by 10 cm. A student says its diagonal is 10 cm. Is that right?
- 10 cm is the longest edge. The diagonal must be longer than any edge.
- Adding edges (24 cm) is also wrong: a straight line is shorter than a bent path.
- .
Final answer: cm, between 10 and 24, as it must be.
Example 3
A room is 5 m long, 4 m wide and 3 m high. What is the longest straight pole that could fit in it?
- m.
Final answer: just over 7 m, from a floor corner to the opposite ceiling corner. The longest wall is only 5 m.
Example 4
A crate measures 40 cm by 30 cm by 120 cm. Will a thin 130 cm rod fit inside?
- cm.

Final answer: yes, but only corner to corner along the diagonal; any thicker and it will not.
Example 5
A cuboid has length 2 m, width 3 m and space diagonal 7 m. Find its height.
- Work backwards: .
- , so .
Final answer: m. Working backwards is where the formula is really tested.
Example 6
For a cuboid measuring 1 by 2 by 2, find the ratio of the space diagonal to the face diagonal of the largest face.
- Space diagonal: .
- The largest face is : its diagonal is .
- .
Final answer: about . The space diagonal always beats the largest face diagonal.
What Are the Most Common Mistakes With the Diagonal of a Cuboid?
Each mistake has a quick size check.
Mistake 1: Stopping at the floor diagonal
Where it slips in: Right after Step 1, when already looks like an answer.
Don't do this: Report as the cuboid's diagonal. It ignores the height.
The correct way: Use all three squares. If your line stays on the floor, add .
Mistake 2: Adding the edges instead of their squares
Where it slips in: When rushing, as in Example 2.
Don't do this: Write , or .
The correct way: Square each edge, add, then take one square root. Write the three squares on separate lines.
Mistake 3: Mixing units
Where it slips in: Boxes given as "1.2 m by 40 cm by 30 cm".
Don't do this: Square 1.2, 40 and 30 as they stand.
The correct way: Convert first: 120, 40 and 30 cm give cm.
Mistake 4: Forgetting the square root
Where it slips in: Long problems where is on the last line.
Don't do this: Answer "169 cm" for the 4 by 3 by 12 box.
The correct way: , so . The diagonal should be just a bit longer than the longest edge.
Mistake 3 has a famous cousin. In 1999 NASA lost the Mars Climate Orbiter because one team gave thruster data in imperial units and another read it as metric.
Why Does the Diagonal of a Cuboid Matter?
"The shortest line across three dimensions at once."
That idea shows up far outside a worksheet.
- Packing and shipping. Whether a pole, ski or pipe fits is decided by the space diagonal, not the longest edge.
- Furniture and rooms. Tipping a wardrobe upright needs its diagonal across depth and height to be under the ceiling height.
- Frames and braces. A corner-to-corner brace is a face or space diagonal; the wrong length leaves a frame that leans.
- 3D graphics and games. Programs wrap objects in invisible boxes and use the diagonal for quick size and collision checks.
Conclusion
- The diagonal of a cuboid is usually the space diagonal, ; a face diagonal uses two squares.
- It is Pythagoras twice, and the same fact as the 3D distance formula.
- All 4 space diagonals are equal, meet at the centre and are the longest line in the box.
- Keep units the same, square before adding, and finish with the square root.
Where Should You Practice the Diagonal of a Cuboid Next?
Measure a shoebox, predict its space diagonal, then check with a string stretched corner to corner. Then try these:
- Find the space diagonal of a cuboid measuring 9 cm by 12 cm by 8 cm.
- A cube has a space diagonal of cm. Find its edge length.
- A box is 24 cm by 32 cm by 30 cm. Find the longest straight rod that fits inside.
- Find the space diagonal of a 2 by 3 by 6 box.
Answers: (1) 17 cm. (2) 6 cm. (3) 50 cm. (4) 7. Stuck on 2? Compare with , as in Example 1.
To work through 3D geometry with a teacher, explore Bhanzu's geometry tutor, a high school math tutor or math classes online.
Want a live Bhanzu trainer to help your child see 3D shapes clearly? Book a free demo class, online globally, or in person at our McKinney, TX center.
Read More
- Difference Between Cube and Cuboid
- Diagonals
- Diagonal of a Parallelogram
- Diagonal of a Hexagon
- Cube Formula
- Pythagorean Triples
Research Behind This Article
- Euclid, Elements, Book I, Proposition 47 (the Pythagoras theorem, used twice), with commentary by D. E. Joyce, Clark University. mathcs.clarku.edu
- OpenStax, Calculus Volume 3, Section 2.2: Vectors in Three Dimensions (the distance formula in space). openstax.org
- NASA Science, Mars Climate Orbiter mission page. science.nasa.gov
- OpenStax, Prealgebra 2e, Section 9.3: Use Properties of Angles, Triangles, and the Pythagorean Theorem. openstax.org
Quick Quiz: Check Yourself
Three levels, questions with figures, instant feedback with the reason.
Was this article helpful?
Your feedback helps us write better content
Frequently Asked Questions
What is the formula for the diagonal of a cuboid?
How many diagonals does a cuboid have?
Are all the diagonals of a cuboid equal?
What is the diagonal of a cube with side s?
Can the diagonal of a cuboid be negative?
