Pythagorean theorem calculator
Solve a² + b² = c² in either direction. Find the hypotenuse from the two legs, or find a missing leg from the hypotenuse and the other leg. The formula used is shown alongside each result, so it doubles as a quick way to check your own working in geometry, construction and trigonometry.
How it works
The theorem relates the three sides of a right triangle, where c is the hypotenuse (the side opposite the right angle):
hypotenuse: c = √(a² + b²)
missing leg: b = √(c² − a²)
When solving for a leg, the calculator checks that the hypotenuse is longer than the known leg, since a real right triangle cannot have a leg as long as or longer than its hypotenuse.
Examples
Hypotenuse from legs 3 and 4:
- c = √(3² + 4²) = √(9 + 16) = √25 = 5
Missing leg from hypotenuse 5 and leg 3:
- b = √(5² − 3²) = √(25 − 9) = √16 = 4
| Solve for | Known sides | Result |
|---|---|---|
| Hypotenuse | a=3, b=4 | c = 5 |
| Hypotenuse | a=5, b=12 | c = 13 |
| Hypotenuse | a=8, b=15 | c = 17 |
| Leg | c=5, a=3 | b = 4 |
| Leg | c=13, a=5 | b = 12 |
Pythagorean triples
A Pythagorean triple is a set of three positive whole numbers where a² + b² = c² exactly. These produce right triangles with no rounding error, making them invaluable in construction when you need a perfect right angle using only a tape measure. The 3-4-5 triangle is the most widely used on job sites: if one side is 3 units and another is 4 units and the diagonal measures exactly 5 units, the angle between the two shorter sides is a perfect 90°.
Common Pythagorean triples to know:
| a | b | c |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 8 | 15 | 17 |
| 7 | 24 | 25 |
| 20 | 21 | 29 |
Scaling any triple preserves the right angle: 6-8-10, 9-12-15, and 30-40-50 all work just as well as 3-4-5.
Real-world applications
The Pythagorean theorem appears far beyond geometry class:
- Construction and carpentry: squaring a foundation or a room using the 3-4-5 rule
- Screen and display sizing: a “65-inch TV” is the diagonal — the theorem gives you the actual width and height given the aspect ratio
- Navigation: the straight-line (as-the-crow-flies) distance between two GPS coordinates on a flat plane uses the same formula
- Right triangle trigonometry: once you know all three sides, you can compute all six trig ratios — sin, cos, tan and their reciprocals
Everything runs in your browser — nothing is uploaded.