What this calculator does
The diagonal of a rectangle is the straight line connecting two opposite corners, cutting the rectangle into two right-angled triangles. Because the length and width meet at a right angle, that diagonal is simply the hypotenuse of a right triangle with those two sides.
The formula is the Pythagorean theorem applied directly: diagonal equals the square root of length squared plus width squared. It comes up constantly in practical settings, from checking whether a piece of furniture will fit through a doorway to squaring up a rectangular frame or foundation.
The formula
Square the length, square the width, add the two together, then take the square root of the total. The result is the straight-line distance between opposite corners of the rectangle.
| Term | Meaning |
|---|---|
| d | Diagonal length, the hypotenuse of the right triangle formed by the length and width. |
| Length and width | The two side lengths of the rectangle, meeting at a right angle. |
The inputs explained
| Field | What to enter |
|---|---|
| Length | The longer side of the rectangle. |
| Width | The shorter side of the rectangle. |
When to use it
Checking if an item fits through an opening
A flat panel or piece of furniture that will not fit upright can sometimes still pass through a doorway or gap on the diagonal, so knowing the diagonal length tells you the true maximum straight-line dimension.
Squaring up a rectangular frame or foundation
A rectangle is only truly square-cornered if both diagonals are equal; measuring the diagonal against this calculated value is a standard way to check a frame, deck or foundation before fixing it in place.
Working out screen or panel size
Screens and panels are commonly specified by their diagonal measurement, so converting a rectangle's length and width into a diagonal, or checking a stated diagonal against known side lengths, uses this same calculation.
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 the diagonal changes as length increases at a fixed width
A fixed width of 5, across a range of lengths.
How the diagonal changes as width increases at a fixed length
A fixed length of 12, across a range of widths.
Questions
Is this the same as a Pythagorean theorem calculation?
Yes. A rectangle's diagonal is exactly the hypotenuse of a right triangle whose two legs are the rectangle's length and width, so the underlying maths is identical to the general Pythagorean theorem.
Do both diagonals of a rectangle have the same length?
Yes, always, for any true rectangle. Both diagonals connect opposite corners and both form the hypotenuse of a congruent right triangle made from the same length and width.
How do I use the diagonal to check a shape is square-cornered?
Measure both diagonals of the actual object. If they match each other, and match the value this calculator gives for the intended length and width, the corners are true right angles; if the measured diagonals differ from each other, the shape is out of square.
Can the diagonal ever be shorter than the length or width?
No. The diagonal is always the longest straight line across a rectangle, since it is the hypotenuse of a right triangle, and a hypotenuse is always longer than either of the two legs that form it.
For a general Pythagorean theorem solver covering any right triangle, see the Pythagoras theorem hypotenuse calculator. For the area and perimeter of the same rectangle, see the volume of rectangle calculator.