The diagonal of a rectangle is d = √l2 + w2: square the length, square the width, add them and take the square root. A diagonal splits a rectangle into two right triangles, so this is the Pythagorean theorem with the diagonal as the hypotenuse. A 12 ft by 9 ft room has a 15 ft diagonal.
How to use the diagonal calculator
- Choose the shape. Rectangle mode needs two of the three measurements. Square mode needs only one, because the length and the width are the same.
- Type the two values you know and leave the third box empty. Length and width give the diagonal; the diagonal and one side give the other side.
- Pick units and rounding. Both measurements must already be in the same unit. With feet or inches, the result also appears in feet, inches and sixteenths, ready for a tape measure.
- Read the results. You get the missing side (exact radical form when there is one), the area, the perimeter, the angle the diagonal makes with the length and the angles where the two diagonals cross.
The calculator always treats the two boxes you typed in most recently as the known values, so you can switch from "find the diagonal" to "find the width" just by typing in a different box. The address bar updates as you type, so you can copy the link to share a calculation.
The rectangle diagonal formula
Every corner of a rectangle is a right angle. Draw a diagonal and you cut the rectangle into two identical right triangles. In each one, the length l and the width w are the legs and the diagonal d is the hypotenuse, so
d2= l2 + w2d= √l2 + w2Rearranging the same equation gives the missing side when you know the diagonal:
l= √d2 − w2w= √d2 − l2The diagonal is always longer than the length and longer than the width, but shorter than the two added together. If you enter a "diagonal" that is not the longest number, no rectangle is possible and the calculator tells you so. For a single right triangle with sides named a, b and c, the Pythagorean theorem calculator does the same job.
Diagonal of a square
For a square with side s, both legs equal s, so d2 = s2 + s2 = 2s2 and
d = s√2 ≈ 1.414 sTo go from the diagonal back to the side, divide by √2: s = d ÷ √2 ≈ 0.707 d. A 10 ft square patio has a diagonal of 10√2 ≈ 14.14 ft, and a square whose diagonal measures 10 in has sides of 10 ÷ √2 = 5√2 ≈ 7.07 in. Each half of a square is a 45-45-90 triangle, which is why the diagonal of a square always meets its sides at exactly 45°.
Worked examples
Example 1: the diagonal of a deck
A deck frame is 16 ft by 24 ft. How long should its diagonals measure?
d2= 162 + 242= 256 + 576 = 832d= √832 = 8√13≈ 28.84 ftAbout 28.84 ft, which is 28 ft 10⅛ in to the nearest sixteenth. (√832 = 8√13 because 832 = 64 × 13; see the square root simplifier.) Both diagonals should read this length when the frame is square.
Example 2: a missing side
A rectangular picture frame is 50 cm wide and its diagonal is 130 cm. How long is it?
l2= 1302 − 502= 16,900 − 2,500 = 14,400l= √14,400 = 120 cmThe frame is 120 cm long. The sides 50, 120 and 130 are the 5-12-13 triangle scaled by 10.
Example 3: across a soccer field
A standard soccer field measures 105 m by 68 m. How far is it from one corner flag to the opposite one?
d2= 1052 + 682= 11,025 + 4,624= 15,649d= √15,649 ≈ 125.10 mAbout 125.1 m. Running the diagonal saves about 48 m compared with running along two sides of the field (173 m).
Common rectangles and their diagonals
| Rectangle | Length × width | Diagonal |
|---|---|---|
| US Letter paper | 11 × 8.5 in | 13.90 in |
| A4 paper | 297 × 210 mm | 363.74 mm |
| Sheet of plywood | 8 × 4 ft | 4√5 ≈ 8.94 ft |
| Bedroom | 12 × 10 ft | 15.62 ft |
| Square room | 12 × 12 ft | 12√2 ≈ 16.97 ft |
| Tennis court (doubles) | 78 × 36 ft | 85.91 ft |
| NBA basketball court | 94 × 50 ft | 106.47 ft |
| American football field with end zones | 360 × 160 ft | 393.95 ft |
| Soccer field (standard) | 105 × 68 m | 125.10 m |
Screens are rectangles too, but they are sold by their diagonal, so you usually work backward from the diagonal and the aspect ratio. The screen size calculator does that for TVs, monitors and phones.
Checking that a corner is square
A four-sided frame with opposite sides equal is a parallelogram. It is a true rectangle, with four right angles, exactly when its two diagonals are equal. That gives builders a quick test that needs nothing but a tape measure: measure both diagonals and compare.
Here is the method for a 16 ft by 12 ft frame:
- Work out the target. √162 + 122 = √400 = 20 ft. (This frame is a 3-4-5 triangle scaled by 4, so the answer is a whole number.)
- Measure both diagonals from the same points on each corner, for example the outside corners, with the tape pulled tight.
- Compare. If one reads 20 ft 3 in and the other 19 ft 9 in, the frame is racked. Push the two corners at the ends of the long diagonal toward each other until both read the same.
Because racking lengthens one diagonal and shortens the other by almost the same amount, the correct length is very close to the average of your two readings: here (20 ft 3 in + 19 ft 9 in) ÷ 2 = 20 ft. The Pythagorean theorem in construction page covers this test and the 3-4-5 method for laying out decks, slabs and walls.
The diagonal angle and where the diagonals cross
The angle θ between the diagonal and the length comes from right-triangle trigonometry: the width is the side opposite θ and the length is the side next to it, so
θ = arctan(w over l)For the 12 by 9 room in the calculator, θ = arctan(9 ÷ 12) ≈ 36.87°, and the diagonal makes the other angle, 90° − 36.87° = 53.13°, with the width.
The two diagonals of a rectangle are equal and cut each other in half, so they meet at the center and form two pairs of angles: 2θ and 180° − 2θ. For the 12 by 9 room these are about 73.74° and 106.26°. Only in a square do the diagonals cross at 90°. To find a diagonal through a box instead of across a flat rectangle, use the 3D Pythagorean theorem calculator, which applies the theorem twice: d = √l2 + w2 + h2.
Frequently asked questions
How do you find the diagonal of a rectangle?
Square the length and the width, add the two squares, then take the square root: d = √l2 + w2. For a 6 by 8 rectangle that is √36 + 64 = √100 = 10. It works because the diagonal is the hypotenuse of a right triangle whose legs are the two sides.
How do I find the width if I know the diagonal and the length?
Subtract instead of adding: w = √d2 − l2. With a 13 in diagonal and a 12 in length, w = √169 − 144 = √25 = 5 in. The diagonal must be the larger number, otherwise the subtraction goes negative and no rectangle exists.
What is the diagonal of a square?
The side times √2, about 1.414 times the side. A square with 5 cm sides has a diagonal of 5√2 ≈ 7.07 cm. To go from the diagonal back to the side, divide by √2, or multiply by about 0.707.
Are both diagonals of a rectangle the same length?
Yes. Each diagonal is the hypotenuse of a right triangle with legs l and w, so both equal √l2 + w2. The reverse is also true for a parallelogram: if its diagonals are equal, its corners are right angles, which is why builders compare diagonals to check for square.
How do I turn a decimal answer like 28.84 ft into feet and inches?
Keep the whole feet (28), multiply the decimal part by 12 to get inches (0.844 × 12 ≈ 10.13 in), then multiply the leftover decimal by 16 to get sixteenths (0.13 × 16 ≈ 2, so 2/16 = 1/8). The answer is 28 ft 10⅛ in. Choose feet or inches as the unit and the calculator does this for you.
Keep exploring
- CalculatorsPythagorean Theorem CalculatorFree Pythagorean theorem calculator. Enter any two sides of a right triangle to find the third, with step-by-step working, exact radical answers and a drawing.
- Real-life usesThe Pythagorean Theorem in ConstructionHow builders use the Pythagorean theorem: the 3-4-5 rule for squaring corners and foundations, diagonal checks, stairs, rafters, ramps, braces and field tips.
- CalculatorsScreen Size Calculator for TVs and MonitorsTV and monitor screen size calculator. Turn a diagonal and aspect ratio into width, height and area in inches and cm, get PPI, and compare two screens.
- Calculators3D Pythagorean Theorem CalculatorFind the space diagonal of a box from its length, width and height, or a missing side from the diagonal, with steps, exact answers and face diagonals.
- LearnThe 45-45-90 TriangleThe 45-45-90 triangle rules: why the sides are in the ratio 1 : 1 : √2, how to find a leg from the hypotenuse, the diagonal of a square, and worked examples.
- TriplesThe 3-4-5 TriangleThe 3-4-5 triangle explained: its angles (36.87° and 53.13°), area, perimeter and inradius, the 3-4-5 rule for square corners, multiples and history.