Enter any two sides of a right triangle to find the third, with the steps, the exact answer and the triangle's angles.
The Pythagorean theorem
In a right triangle, the square of the longest side (the hypotenuse, c) equals the sum of the squares of the other two sides (the legs, a and b):
a² + b² = c²
- Find the hypotenuse: c = √(a² + b²). With legs 3 and 4: √(9 + 16) = √25 = 5.
- Find a leg: a = √(c² − b²). With hypotenuse 13 and leg 5: √(169 − 25) = √144 = 12.
The theorem only works for right triangles (one 90° angle), and the hypotenuse is always the side opposite that angle.
Pythagorean triples
Some right triangles have whole-number sides. These are handy to remember, and any multiple of them works too (6, 8, 10 is double 3, 4, 5).
| a | b | c |
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 8 | 15 | 17 |
| 7 | 24 | 25 |
| 20 | 21 | 29 |
| 9 | 40 | 41 |
Real-life uses
Builders use the 3-4-5 rule to check a corner is square: measure 3 feet along one side and 4 feet along the other, and the diagonal should be exactly 5 feet. The same idea gives a ladder's reach up a wall, a TV's diagonal size, or the straight-line distance across a park.
How we checked this
Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:
- Legs 3 and 4 give hypotenuse 5 ✓
- Hypotenuse 13 and leg 5 give 12 ✓
- Legs 5 and 5 give 5√2 ✓
Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.
Questions people ask
How do you find the hypotenuse?
Square both legs, add them, and take the square root. For legs 6 and 8: √(36 + 64) = √100 = 10.
How do you find a missing leg?
Square the hypotenuse, subtract the square of the known leg, and take the square root.
Why is my answer like 5√2?
When the answer isn't a whole number, the exact value is a square root. 5√2 is exact; 7.0710678 is its decimal.
Does it work for any triangle?
No, only right triangles. For other triangles use the law of cosines.