Pythagorean theorem calculator for any right triangle
This Pythagorean theorem calculator finds the missing side of a right triangle. Give it the two legs to get the hypotenuse, or the hypotenuse and one leg to get the other leg. It shows the working step by step using a² + b² = c², gives the exact square-root form when the answer is not a whole number (such as √2 or 2√5), and draws the triangle to scale with the solved side highlighted.
You also get both acute angles, the area, perimeter, the height from the right angle to the hypotenuse, and the inradius and circumradius — plus a check for whether your three sides form a Pythagorean triple such as 3-4-5 or 5-12-13. It is built for geometry homework, but just as handy for checking a ladder’s reach, a screen’s diagonal, a roof rafter or whether a corner is square.
How to use the Pythagorean Theorem Calculator
- Choose what to solve for: the hypotenuse c, or one of the legs a or b.
- Enter the two sides you know. The legs a and b meet at the right angle; the hypotenuse c is the longest side, opposite it.
- Optionally choose a unit so the results and drawing are labelled with it.
- Read the missing side in the result panel, with the exact root (if any) and the working below.
- Check the triple message, the angles, area and other measurements, and the scale drawing.
Pythagorean Theorem Calculator features
Solve for any side
Find the hypotenuse from two legs, or a leg from the hypotenuse and the other leg.
Exact radical answers
Whole-number inputs give simplified roots such as 2√5 alongside the decimal.
Scale drawing
The triangle is drawn in true proportion, with the right angle marked, angles labelled and the solved side highlighted.
Angles and more
Both acute angles, area, perimeter, altitude to the hypotenuse, its two segments, inradius and circumradius.
Pythagorean triple check
Tells you whether the sides are a triple and whether it is primitive or a multiple, like 6-8-10 = 2 × 3-4-5.
The Pythagorean theorem
In any right-angled triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c². Rearranged, it gives every side: c = √(a² + b²), a = √(c² − b²) and b = √(c² − a²). The theorem only applies to right triangles; for other triangles, use the law of cosines, c² = a² + b² − 2ab cos C, which reduces to Pythagoras when C = 90°.
The same idea gives the distance between two points on a graph: the horizontal and vertical differences are the legs, and the straight-line distance is the hypotenuse, d = √((x₂ − x₁)² + (y₂ − y₁)²).
Worked examples
- Ladder against a wall: a 5 m ladder stands 1.5 m from the wall. How high does it reach? a = √(5² − 1.5²) = √(25 − 2.25) = √22.75 ≈ 4.77 m.
- TV screen size: a screen 48 inches wide and 27 inches tall has a diagonal of √(48² + 27²) = √3033 ≈ 55.1 inches — sold as a 55-inch TV.
- Checking a corner is square: builders use the 3-4-5 rule. Mark 3 ft along one wall and 4 ft along the other; if the diagonal between the marks is exactly 5 ft, the corner is 90°. Multiples such as 6-8-10 work too.
- Exact answer: legs of 2 and 4 give c = √20 = √(4 × 5) = 2√5 ≈ 4.4721.
Pythagorean triples
A Pythagorean triple is a set of three whole numbers that fit a² + b² = c². A triple is primitive when the three numbers share no common factor; multiplying a primitive triple by any whole number gives another triple. Every primitive triple can be generated with Euclid’s formula: for whole numbers m > n > 0 with no common factor and not both odd, a = m² − n², b = 2mn and c = m² + n². For example, m = 2 and n = 1 give 3, 4, 5.
If your answer is not a whole number, the square root calculator can simplify it further, and the area calculator handles triangles that are not right-angled, using Heron’s formula. Angles can be converted to radians with the angle converter.
| Primitive triple | Check | Multiples |
|---|---|---|
| 3, 4, 5 | 9 + 16 = 25 | 6-8-10, 9-12-15 |
| 5, 12, 13 | 25 + 144 = 169 | 10-24-26 |
| 8, 15, 17 | 64 + 225 = 289 | 16-30-34 |
| 7, 24, 25 | 49 + 576 = 625 | 14-48-50 |
| 20, 21, 29 | 400 + 441 = 841 | 40-42-58 |
Pythagorean Theorem Calculator FAQ
How do I use the Pythagorean theorem calculator?
Choose the side you want to find, enter the other two sides and read the answer. For the hypotenuse, enter both legs; for a leg, enter the hypotenuse and the other leg. The working, exact root, angles and a scale drawing appear instantly.
How do I find the hypotenuse?
Square both legs, add them, and take the square root: c = √(a² + b²). With legs 6 and 8, c = √(36 + 64) = √100 = 10.
How do I find a missing leg?
Subtract the square of the known leg from the square of the hypotenuse and take the square root: a = √(c² − b²). With c = 13 and b = 5, a = √(169 − 25) = √144 = 12.
Why does it say the hypotenuse must be the longest side?
The hypotenuse is opposite the right angle, so it is always longer than either leg. If c is not greater than the leg you entered, c² − b² would be zero or negative and no right triangle exists.
Does the Pythagorean theorem work for all triangles?
No — only for right triangles. For other triangles use the law of cosines, c² = a² + b² − 2ab cos C. If a² + b² is greater than c², the angle opposite c is acute; if it is smaller, the angle is obtuse.
What is the most famous Pythagorean triple?
3, 4, 5 is the smallest and best known. Others include 5-12-13, 8-15-17 and 7-24-25, and any whole-number multiple of a triple, such as 6-8-10, is also a triple.