
The Pythagorean theorem says that in a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a2 + b2 = c2. If the legs are 3 and 4, then c2 = 9 + 16 = 25, so the hypotenuse is 5. You can use it to find any missing side of a right triangle and to check whether a triangle has a right angle.
In short: Hypotenuse: c = √(a2 + b2). Missing leg: a = √(c2 − b2). The hypotenuse c is always the longest side, opposite the right angle.
In this guide
The Pythagorean Theorem Formula
A right triangle has one 90° angle. The two sides that form the right angle are the legs (a and b). The side across from the right angle is the hypotenuse (c), and it is always the longest side.

The rule only works for right triangles. For other triangles, use the law of cosines, which the triangle calculator applies for you.
How to Find the Hypotenuse
- Square each leg.
- Add the two squares.
- Take the square root of the sum.
Example: Legs 6 and 8. 62 + 82 = 36 + 64 = 100, and √100 = 10.
Example: Legs 5 and 9. 52 + 92 = 25 + 81 = 106, and √106 ≈ 10.30. Not every answer is a whole number; leave it as √106 for an exact answer or round it.
How to Find a Missing Leg
Rearrange the formula: a2 = c2 − b2. Square the hypotenuse, subtract the square of the known leg, then take the square root.
Example: Hypotenuse 13, leg 5. 132 − 52 = 169 − 25 = 144, and √144 = 12.
Example: Hypotenuse 10, leg 7. 102 − 72 = 100 − 49 = 51, and √51 ≈ 7.14.
Is It a Right Triangle? (The Converse)
The theorem also works backwards. Put the longest side as c and compare a2 + b2 with c2:
| If a² + b² is… | The triangle is… | Example |
|---|---|---|
| equal to c² | right | 7, 24, 25: 49 + 576 = 625 = 25² |
| greater than c² | acute (all angles under 90°) | 6, 7, 9: 36 + 49 = 85 > 81 |
| less than c² | obtuse (one angle over 90°) | 4, 5, 7: 16 + 25 = 41 < 49 |
Pythagorean Triples
A Pythagorean triple is a set of three whole numbers that fit a2 + b2 = c2. Knowing the common ones saves time on tests.
| Triple | Check |
|---|---|
| 3, 4, 5 | 9 + 16 = 25 |
| 5, 12, 13 | 25 + 144 = 169 |
| 8, 15, 17 | 64 + 225 = 289 |
| 7, 24, 25 | 49 + 576 = 625 |
| 20, 21, 29 | 400 + 441 = 841 |
| 9, 40, 41 | 81 + 1,600 = 1,681 |
Any multiple of a triple is also a triple: 3, 4, 5 doubled is 6, 8, 10, and 36 + 64 = 100.
Real-Life Word Problems
Example: Ladder. A 13 ft ladder leans on a wall with its foot 5 ft from the wall. How high does it reach? √(132 − 52) = √144 = 12 ft.
Example: Walking. You walk 9 km east and then 12 km north. How far are you from the start? √(81 + 144) = √225 = 15 km.
Example: TV size. A 55-inch TV is measured on the diagonal. With a 16:9 screen, the width is 55 × 16 ÷ √337 ≈ 47.94 in and the height is 55 × 9 ÷ √337 ≈ 26.96 in, because 162 + 92 = 337.
Example: Square diagonal. A square with 7 cm sides has a diagonal of √(49 + 49) = 7√2 ≈ 9.90 cm.
The Distance Formula and 3D Diagonals
The distance formula is the Pythagorean theorem on a grid. From (1, 2) to (7, 10), the horizontal change is 6 and the vertical change is 8, so the distance is √(36 + 64) = 10.
In three dimensions, add one more square. A box that is 3 by 4 by 12 has a space diagonal of √(9 + 16 + 144) = √169 = 13.
How to Do It on a Calculator
On a scientific calculator, type √(5^2+9^2) and press equals to get 10.2956…. Put the whole sum inside the square root bracket; the order of operations matters here. See square roots and cube roots for estimating roots by hand.
Try it
Enter two sides of a right triangle and get the third side, the angles and the area, with steps.
Common Mistakes
- Using the theorem on a triangle with no right angle. Check for the 90° angle first.
- Putting the hypotenuse in the wrong place. c must be the longest side, opposite the right angle.
- Adding when you should subtract. To find a leg, subtract: a2 = c2 − b2.
- Forgetting the square root. 9 + 16 = 25 is c2, not c.
- Adding the sides before squaring. (3 + 4)2 = 49, not 25.
Practice Problems (With Answers)
1. The legs are 9 and 12. Find the hypotenuse.
81 + 144 = 225, so c = 15.
2. The hypotenuse is 17 and one leg is 8. Find the other leg.
289 − 64 = 225, so the leg is 15.
3. Are 10, 24 and 26 the sides of a right triangle?
Yes: 100 + 576 = 676 = 262.
4. The legs are 4 and 6. Find the hypotenuse to two decimal places.
16 + 36 = 52, so c = √52 ≈ 7.21.
5. A rectangle is 8 m by 15 m. How long is its diagonal?
64 + 225 = 289, so the diagonal is 17 m.
Need an angle instead of a side? Use SOHCAHTOA (sin, cos and tan).
FAQ
What is the Pythagorean theorem formula?
a² + b² = c², where a and b are the legs of a right triangle and c is the hypotenuse. For legs 3 and 4, c = √25 = 5.
How do you find the hypotenuse?
Square both legs, add them, and take the square root: c = √(a² + b²). For legs 6 and 8, c = √100 = 10.
How do you 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²). For c = 13 and b = 5, a = √144 = 12.
Does the Pythagorean theorem work for all triangles?
No. It works only for right triangles. For other triangles, use the law of cosines.
What is a Pythagorean triple?
Three whole numbers that satisfy a² + b² = c², such as 3, 4, 5 or 5, 12, 13.
Sources and Further Reading
- OpenStax, Prealgebra 2e, Section 9.3: Use Properties of Angles, Triangles, and the Pythagorean Theorem, Rice University.
- Common Core Grade 8 Geometry (8.G.B.6–8: understand and apply the Pythagorean theorem).
Related: square roots and cube roots, exponent rules, the quadratic formula and all free math calculators.
Check your working in seconds
Type any problem from this guide into the free CalcSolver calculator and see the answer, with fractions, instantly.


