The Pythagorean theorem states that a² + b² = c² in a right triangle. The letters a and b represent the two perpendicular legs, and c represents the hypotenuse, opposite the 90° angle. Use it to find a missing side when you know the other two sides.
To find the hypotenuse, add the squares of the legs and take the square root. To find a missing leg, subtract the square of the known leg from the square of the hypotenuse, then take the square root.
Pythagorean theorem formulas
| Find or check | Formula | When to use it |
|---|---|---|
| Relationship between sides | a² + b² = c² | The triangle has a right angle. |
| Hypotenuse c | c = √(a² + b²) | Both legs are known. |
| Missing leg a | a = √(c² − b²) | The hypotenuse and leg b are known. |
| Missing leg b | b = √(c² − a²) | The hypotenuse and leg a are known. |
All side lengths must use the same unit before substitution. The final answer is a length, such as cm or m. Although the intermediate calculation uses squared lengths, the square root returns the answer to ordinary length units.
How to use the Pythagorean theorem
- Confirm that the triangle has a 90° angle. A sketch that only looks like a right triangle is not enough.
- Label the side opposite the right angle c. You can call either of the remaining sides a or b.
- Choose the formula for the unknown side and substitute the known lengths.
- Square first, then add or subtract. Take the positive square root because a side length is positive.
- Check that the hypotenuse is longer than either leg, and round only the final result.
The triangle can be rotated or reflected without changing these rules. The hypotenuse does not have to be the sloping side on the page: identify it by the right angle.
Worked examples
1. Find the hypotenuse
A right triangle has legs of 7 cm and 24 cm. Find its longest side.
c = √(7² + 24²) = √(49 + 576) = √625 = 25 cm.
Check: 25 is greater than both 7 and 24. Also, 7² + 24² equals 25², so the answer satisfies the original equation.
2. Find a missing leg
The hypotenuse measures 17 m and one leg measures 8 m. The unknown side is a leg, so subtract rather than add.
b = √(17² − 8²) = √(289 − 64) = √225 = 15 m.
Adding would give a side longer than 17 m, which cannot be another leg when 17 m is already the hypotenuse. A negative number under the square root also signals inconsistent lengths or a labelling error.
3. Give an exact and a rounded answer
A right triangle has two legs of 6 cm. Its hypotenuse is not a whole number.
c = √(6² + 6²) = √72 = 6√2 cm ≈ 8.49 cm.
The expression 6√2 is exact. The decimal 8.49 is rounded to two decimal places, so use the approximately-equal sign. More generally, equal perpendicular legs of length s give a hypotenuse of s√2.
4. Convert mixed units first
The perpendicular sides of a right triangle measure 120 cm and 1.6 m. Convert 120 cm to 1.2 m before using the formula.
c = √(1.2² + 1.6²) = √(1.44 + 2.56) = √4 = 2 m.
You could instead convert 1.6 m to 160 cm and obtain 200 cm. Both methods give the same length. Combining 120 and 1.6 without conversion would produce an incorrect result.
5. Find the diagonal of a rectangle
A rectangular garden is 9 m wide and 12 m long. A straight path joining opposite corners forms the hypotenuse of a right triangle.
d = √(9² + 12²) = √225 = 15 m.
The diagonal is 15 m. The route along two adjoining edges would be 9 + 12 = 21 m, so it measures a different distance. See rectangle formulas for area, perimeter and diagonal calculations.
Pythagorean triples
A Pythagorean triple is a set of three positive whole numbers that satisfies a² + b² = c². Recognising common triples can speed up a calculation, but you should still check which side is the hypotenuse.
| Leg a | Leg b | Hypotenuse c |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 8 | 15 | 17 |
| 7 | 24 | 25 |
Multiplying every side of a triple by the same positive whole number gives another triple. For example, doubling 3–4–5 produces 6–8–10 because 36 + 64 = 100. Adding the same number to each side does not generally preserve the relationship.
How to check whether a triangle is right angled
The converse of the theorem works in the other direction: if the side lengths of a triangle satisfy a² + b² = c², with c the longest side, the angle opposite c is 90°.
Example: for sides 6, 8 and 10, compare 6² + 8² = 100 with 10² = 100. They match, so the triangle is right angled. For sides 6, 7 and 10, 36 + 49 = 85, which does not equal 100; that triangle is not right angled.
If you are given arbitrary lengths, first check that they can form a triangle: the sum of the two shorter sides must exceed the longest side. Zero or negative side lengths are not valid.
Common mistakes to avoid
- Using a + b = c. The theorem relates squares of side lengths, not the lengths themselves.
- Forgetting the final square root. If c² = 81, then c = 9, not 81.
- Subtracting when finding the hypotenuse, or adding when finding a missing leg.
- Mixing centimetres and metres without conversion.
- Applying the formula to a triangle with no established right angle.
Practice questions
Try each question before checking the answers. All triangles below are right angled unless the question asks you to test them.
- The legs are 9 cm and 12 cm. Find the hypotenuse.
- The hypotenuse is 13 m and one leg is 5 m. Find the other leg.
- Both legs measure 5 cm. Give the exact hypotenuse and a decimal to two places.
- A rectangle measures 8 m by 15 m. Find its diagonal.
- Do side lengths of 9, 12 and 16 units form a right triangle?
Practice answers
- 15 cm: √(81 + 144) = √225.
- 12 m: √(169 − 25) = √144.
- 5√2 cm ≈ 7.07 cm: √(25 + 25) = √50.
- 17 m: √(64 + 225) = √289.
- No: 9² + 12² = 225, whereas 16² = 256. The lengths form a triangle, but it is not right angled.
Frequently asked questions
Does the Pythagorean theorem work for every triangle?
No. It applies to right triangles. For a triangle without a right angle, a different relationship, such as the cosine rule, is needed to connect the side lengths and angles.
How do I know which side is c?
In a² + b² = c², c is the hypotenuse: the side opposite the right angle. It is the longest side. The letters used in a question may differ, so identify the side by its position before substituting.
Can I use decimals or fractions?
Yes. The theorem works with any positive side lengths of a right triangle, including decimals, fractions and irrational numbers. Keep units consistent and retain exact values until the final rounding step.
Can the theorem find the area?
It finds side lengths directly. Once the perpendicular legs are known, the area is A = ab/2. For example, legs of 3 cm and 4 cm give an area of 6 cm². See triangle area and perimeter formulas for more methods.
How is it related to the distance formula?
On a coordinate plane, the horizontal and vertical changes between two points form perpendicular legs. Applying the theorem gives d = √[(x₂ − x₁)² + (y₂ − y₁)²]. The distance formula guide shows worked coordinate examples.
Related formula guides
Continue with triangle formulas, square diagonals or rectangular prism diagonals. Browse all 2D formulas for other plane shapes.
Reference: OpenStax, Prealgebra 2e, Section 9.3, “Use Properties of Angles, Triangles, and the Pythagorean Theorem”; Elementary Algebra 2e, Section 3.4, geometry applications. The worked examples and diagram on this page are original.
