The Pythagorean theorem
In a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides:
a² + b² = c²
Here a and b are the legs, the two sides that meet at the right angle, and c is the hypotenuse, the longest side, opposite the right angle.
How to find each side
| To find | Formula | Example |
|---|---|---|
| Hypotenuse c | c = √(a² + b²) | a = 3, b = 4: c = √(9 + 16) = √25 = 5 |
| Leg a | a = √(c² − b²) | c = 13, b = 12: a = √(169 − 144) = √25 = 5 |
| Leg b | b = √(c² − a²) | c = 10, a = 6: b = √(100 − 36) = √64 = 8 |
The hypotenuse is always the longest side, so when you find a leg, c must be larger than the side you know.
Pythagorean triples
Some right triangles have whole-number sides. These sets are called Pythagorean triples, and builders and students use them as handy checks.
| a | b | c |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 8 | 15 | 17 |
| 7 | 24 | 25 |
| 20 | 21 | 29 |
| 9 | 40 | 41 |
Any multiple of a triple also works, such as 6, 8 and 10.
Real-world uses
- Checking a square corner. Builders measure 3 feet along one side and 4 feet along the other. If the diagonal is exactly 5 feet, the corner is square. For bigger layouts, use 6-8-10 or 9-12-15.
- Ladder safety. A 20-foot ladder with its base 5 feet from the wall reaches about √(400 − 25) ≈ 19.4 feet up.
- Screen sizes. A TV’s size is its diagonal. A screen 48 inches wide and 27 inches tall is about 55 inches diagonally.
- Distance on a map. Walking 3 blocks east and 4 blocks north puts you 5 blocks away in a straight line.
Angles, area and height
The calculator also gives the two acute angles, which add up to 90°, the area (half of a × b), the perimeter, and the height from the right angle to the hypotenuse, which is a × b ÷ c.
For powers and roots, try the exponent calculator and the square root calculator.
How to use the Pythagorean theorem calculator
- Choose what to find. Under Find, pick Hypotenuse (c), Leg a or Leg b. The box for that side disappears.
- Enter the two sides you know. Use the same unit for both, such as inches, feet or meters. The answer comes out in that unit.
- Check the picture. The small drawing shows which side is which: a and b meet at the square corner, and c is the slanted side opposite it.
- Press Calculate. Your result shows the missing side, the working in three lines, and a table with the area, perimeter, both angles and the height to the hypotenuse.
Worked example: finding the hypotenuse
A right triangle has legs of 5 and 7. With Find set to Hypotenuse (c), the working reads:
- c² = a² + b²
- c² = 5² + 7² = 25 + 49 = 74
- c = √74 = 8.602325
The table adds the rest of the triangle: area 17.5, perimeter 20.602325, angle opposite a 35.537678°, angle opposite b 54.462322° and height to the hypotenuse 4.068667. The two angles add up to 90°, as they always do in a right triangle. Answers are shown to at most six decimal places. If the legs were in feet, the hypotenuse is 8.602325 feet, which is a little over 8 feet 7 inches.
Worked example: finding a missing leg
Say the hypotenuse is 15 and one leg, a, is 9. Choose Leg b and enter the other two. The working is b² = 15² − 9² = 225 − 81 = 144, so b = √144 = 12. Because 9, 12 and 15 are all whole numbers, the result adds a note that they form a Pythagorean triple. This one is the 3-4-5 triangle scaled up three times, so its angles are the same: about 36.869898° and 53.130102°.
If you enter a hypotenuse that is shorter than or equal to the leg, the calculator stops and says the hypotenuse must be longer. No right triangle can have those sides.
How the calculator works out each value
- Hypotenuse. It uses the browser’s built-in function for the square root of a sum of squares.[2] That function avoids the overflow you can get by squaring very large numbers first, so sides of any realistic size are safe.[2]
- A leg. It takes the square root of c² minus the square of the known leg.
- Angles. Each acute angle comes from the ratio of the side opposite it to the side next to it, the arctangent, turned into degrees.
- Area and height. The legs are the base and height, so the area is half of a × b. Dividing a × b by c gives the height from the right angle to the hypotenuse.
Special right triangles
When both legs are equal, the triangle is an isosceles right triangle. With legs of 1, the calculator gives a hypotenuse of 1.414214, which is √2, and two angles of 45°. Any isosceles right triangle has a hypotenuse about 1.414 times its leg. The other common shape is the 30-60-90 triangle, whose hypotenuse is twice its shortest side. For both, the special right triangles calculator works from a single side.
Common mistakes
- Typing the hypotenuse as a leg. The hypotenuse is always the longest side and sits opposite the right angle. Put it only in the Hypotenuse c box.
- Stopping at c². In the first example, 74 is the square of the hypotenuse, not the hypotenuse. The last step, the square root, gives the side itself.
- Mixing units. Feet in one box and inches in the other give a wrong answer. Convert first.
- Using it on other triangles. The theorem needs a 90° angle. For other triangles, use the triangle calculator.
- Rounding sides before you start. Enter measurements as precisely as you have them and round only the final answer.
What next
Use this often? Add Pythagorean to your Home screen.
Frequently asked questions
What is the Pythagorean theorem?
In a right triangle, a² + b² = c², where c is the hypotenuse and a and b are the other two sides.
How do I find the hypotenuse?
Square the two legs, add them, and take the square root: c = √(a² + b²). For legs of 3 and 4, c = 5.
How do I find a missing leg?
Subtract the square of the known leg from the square of the hypotenuse, then take the square root: a = √(c² − b²).
Does it work for any triangle?
No. It only works for right triangles, which have one 90° angle.
What is the hypotenuse of a right triangle with legs 5 and 7?
The hypotenuse is √74, about 8.602325. Square the legs, add them to get 74, then take the square root.
Why does the Pythagorean theorem calculator say the hypotenuse must be longer?
When you find a leg, the hypotenuse you enter must be longer than the other leg. If it isn’t, the sides can’t form a right triangle, so there is no answer.
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.