Right-Triangle Diagonal Calculator
Enter any two values below and leave the third blank. This tool calculates the missing side using the Pythagorean theorem.
Formula reference: d = √(w² + h²)
What Is a Diagonal?
A diagonal is a straight line segment that connects two non-adjacent corners of a shape. In a rectangle, the diagonal runs from one corner to the opposite corner. In right-triangle terms, that same diagonal is called the hypotenuse. If you know the width and height, you can always calculate the diagonal quickly.
This diagonal calculator is designed for practical use: measuring screens, finding board lengths, planning room layouts, checking construction dimensions, or solving geometry homework. It works whenever the width and height form a right angle (90°).
How the Calculator Works
Pythagorean Theorem
The calculator uses the classic equation:
d = √(w² + h²)
- w = width (side A)
- h = height (side B)
- d = diagonal (hypotenuse)
If the diagonal is known and one side is known, the missing side can be found by rearranging the same equation:
- w = √(d² - h²)
- h = √(d² - w²)
Common Uses for a Diagonal Calculator
- TV and monitor sizing: Compare physical screen dimensions with stated diagonal size.
- Home improvement: Check whether furniture can fit through an opening on a diagonal path.
- Construction and framing: Confirm squareness by comparing diagonal measurements.
- Math and engineering: Solve right triangles accurately and quickly.
- Graphic and UI design: Convert between pixel width/height and diagonal length for displays.
Worked Examples
Example 1: Rectangle Diagonal
A panel is 12 inches wide and 5 inches high. Its diagonal is:
d = √(12² + 5²) = √(144 + 25) = √169 = 13 inches.
Example 2: Missing Width
You know the diagonal is 20 cm and the height is 16 cm. Width is:
w = √(20² - 16²) = √(400 - 256) = √144 = 12 cm.
Example 3: Quick Room Planning
A rectangular room section is 3.6 m by 4.8 m. The corner-to-corner distance is:
d = √(3.6² + 4.8²) = √(12.96 + 23.04) = √36 = 6 m.
That tells you the minimum straight-line length needed for materials running diagonally across the space.
Tips for Accurate Results
- Use the same unit for all entries (all inches, all centimeters, etc.).
- Enter only positive numbers.
- Leave exactly one field blank so the calculator knows what to solve for.
- For side calculations, make sure diagonal is larger than the known side.
- Round only at the final step to keep precision high.
Diagonal vs. Area and Perimeter
The diagonal tells you corner-to-corner length, which is different from area or perimeter:
- Area: w × h (space inside the rectangle)
- Perimeter: 2(w + h) (distance around edges)
- Diagonal: √(w² + h²) (direct corner-to-corner line)
Depending on your project, you may need all three values. The diagonal is especially helpful for fit checks, bracing, alignment, and display sizing.
Frequently Asked Questions
Does this work for any shape?
This calculator is for right triangles and rectangles where width and height meet at 90°. For other polygons, diagonal formulas differ.
Can I use decimals?
Yes. Decimal values are fully supported, which is useful for precision measurement in design and construction.
What if I get an error?
Errors usually happen when more than one field is blank, all fields are filled, or the diagonal is too short to form a valid right triangle. Check your numbers and try again.
Final Thoughts
A diagonal calculator is a simple but powerful tool. Whether you are solving a geometry problem, selecting the right screen size, or planning a build, a fast and accurate diagonal value can save time and prevent costly mistakes. Enter two values, click calculate, and get your result instantly.