Diagonal Length Calculator: Formula & Examples
- Angle from horizontal
- deg
- Result
- Perimeter
- m
- Result
- Width
- 3 m
- You entered
This calculator finds the diagonal length of a rectangle or square from its width and height. Enter the two side lengths, and you get the diagonal distance, the angle of the diagonal from the horizontal, and the perimeter—all in your chosen units. The result is based on the Pythagorean theorem, so it works for any rectangle, including squares.
Formula
The diagonal of a rectangle is the straight line connecting two opposite corners. Its length is given by the Pythagorean theorem:
d = √(w² + h²)
Where:
- d = diagonal length (same unit as w and h)
- w = width of the rectangle
- h = height of the rectangle
For a square, w = h, so the formula simplifies to d = w × √2. For example, a square with side 5 cm has a diagonal of 5 × 1.414 = 7.07 cm.
Worked Example
Using the calculator defaults: width = 3 m, height = 4 m.
- Square the width: 3² = 9
- Square the height: 4² = 16
- Add them: 9 + 16 = 25
- Take the square root: √25 = 5
The diagonal is 5 m. This matches the calculator output (5.00 m).
How to Use the Diagonal Calculator
Simply enter the width and height in any consistent unit—meters, feet, inches, centimeters—and the calculator returns the diagonal in the same unit. If you enter width in feet and height in inches, the result will be mathematically wrong because the units don’t match. Always convert to a single unit first.
For a square, you can enter the same value in both fields. The calculator will also show the angle of the diagonal relative to the horizontal, which is useful when you need to know the orientation, such as for a TV mount or a solar panel.
Where Diagonal Length Is Used
Diagonal measurements appear in many everyday situations:
- TV and monitor sizes: Screen size is the diagonal in inches, so this calculator helps you find the actual width and height from the diagonal and aspect ratio.
- Construction and carpentry: Checking that a frame is square by comparing diagonals (they should be equal).
- Moving furniture: Determining if a sofa or table will fit through a doorway or elevator.
- Computer graphics: Calculating the size of an image or layout when scaled.
- Sports fields: Measuring diagonal distances for training or planning.
Common Mistakes and How to Avoid Them
The most frequent error is mixing units. If you measure width in inches and height in centimeters, the diagonal will be meaningless. Always convert to the same unit before calculating.
Another mistake is using the wrong formula. Some people try to average the sides or use the perimeter. The diagonal is always longer than either side, but shorter than the sum of both sides. For a 3-4 rectangle, the diagonal is 5, not 3.5 or 7.
Rounding too early can also cause errors. If you round the square root of 2 to 1.41, you get a slightly off answer. Use the calculator’s full precision, or round only at the final step.
Limitations of the Formula
The Pythagorean theorem assumes a perfect rectangle with right angles. Real-world objects may have slight irregularities, but for most practical purposes the formula is accurate. It does not account for thickness or curvature. For a cube or 3D box, you would need the 3D diagonal formula: √(w² + h² + d²), which is not covered here.
Also, the formula gives the straight-line distance, not the distance along a curved surface. If you’re measuring a curved screen or a rounded corner, the diagonal will differ slightly.
Frequently Asked Questions
How do I find the diagonal of a square?
For a square, multiply the side length by √2 (approximately 1.414). For example, a square with side 10 cm has a diagonal of 14.14 cm. You can also use the calculator by entering the same value for width and height.
What if I only know the diagonal and one side?
Rearrange the formula: the unknown side = √(d² – known_side²). For instance, if the diagonal is 13 cm and one side is 5 cm, the other side is √(169 – 25) = √144 = 12 cm.
Does the diagonal change if I rotate the rectangle?
No. The diagonal length depends only on the two side lengths, not on the orientation. Rotating a rectangle doesn’t change its dimensions.
Can I use this for a TV screen size?
Yes, if you know the width and height of the screen area. TV sizes are quoted as the diagonal, so you can also work backward: if you know the diagonal and the aspect ratio (e.g., 16:9), you can find the width and height. This calculator gives the diagonal from width and height, which is the reverse.
What units should I use?
Any unit works, as long as both inputs are in the same unit. The output will be in that same unit. For example, if you enter feet, the diagonal is in feet.
Related
Formula used
in w | Width | m | 3 | 0 in h | Height | m | 4 | 0 out d | Diagonal | m | sqrt(w^2 + h^2) | 2 out angle | Angle from horizontal | deg | atan2(h, w) | 1 out perim | Perimeter | m | 2 * (w + h) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.