Pythagorean theorem:
finding the hypotenuse and the missing leg
Add the squares of the two legs to get the hypotenuse, subtract to get a missing leg. Only right-angled triangles qualify.
Calcylator Editorial Team
Updated · 5 min read
What the theorem says and when it applies
In a triangle with one right angle, the side opposite that angle is called the hypotenuse. It is always the longest side. The theorem says the square built on it has the same area as the two squares built on the other sides, the legs, put together.
- a, b:
- the two legs, meeting at the right angle
- c:
- the hypotenuse, opposite the right angle
The statement is only true for right triangles. If you are unsure whether the corner is a right angle, the converse helps: when the three sides satisfy a² + b² = c², the triangle must be right-angled. Builders use this as the 3-4-5 check for square corners.
Finding the hypotenuse
Square both legs, add, then take the square root. Taking the root is the step people forget; the sum itself is c², not c.
- a, b:
- legs of the triangle
Leg a
9 cm
Leg b
12 cm
Hypotenuse
15 cm
9² = 81 and 12² = 144. 81 + 144 = 225. √225 = 15.
That one was a whole number. Most are not. With legs of 5 and 7 the sum is 25 + 49 = 74, and √74 = 8.602 to three decimals, so you round to the precision the job needs.
Keep the unrounded square root in your calculator until the last step. If you round √74 to 8.6 and then use it in a later calculation, the error compounds. Round only the final figure, and to the precision your tape measure can really support; quoting 8.602325 m on a building site implies a precision nobody can cut to.
Finding a missing leg
When the hypotenuse is known, the legs are what is left. Subtract the known leg's square from the hypotenuse square, then take the root.
- c:
- hypotenuse
- b:
- the known leg
Hypotenuse
17 cm
Known leg
8 cm
Missing leg
15 cm
17² = 289 and 8² = 64. 289 − 64 = 225. √225 = 15.
A sanity check always works: the answer must be shorter than the hypotenuse. If you get something longer, you added when you should have subtracted.
Everyday uses: ladders, screens and diagonals
Ladders are the classic case. A 5 m ladder with its foot 1.5 m from the wall forms a right triangle with the wall and the ground, so it reaches √(25 − 2.25) = √22.75 = 4.77 m up.
- A rectangular room measuring 4 m by 3 m has a diagonal of 5 m, useful for checking that a frame is square.
- A TV advertised as 55 inches is a diagonal; with a 16:9 shape the width and height follow from the same theorem.
- A roof rise and run give the length of the rafter before any cutting allowance.
Integer triples worth remembering
| Triple (a, b, c) | Check | Scaled versions |
|---|---|---|
| 3, 4, 5 | 9 + 16 = 25 | 6-8-10, 9-12-15, 30-40-50 |
| 5, 12, 13 | 25 + 144 = 169 | 10-24-26 |
| 8, 15, 17 | 64 + 225 = 289 | 16-30-34 |
| 7, 24, 25 | 49 + 576 = 625 | 14-48-50 |
Every multiple of a triple is also a triple, so 9-12-15 is just the 3-4-5 triangle tripled. Spotting one lets you skip the arithmetic entirely.
The converse can also sort triangles by their corner. For sides a ≤ b ≤ c, if a² + b² equals c² the triangle is right-angled, if it is greater the triangle is acute, and if it is less the triangle is obtuse. Sides of 4, 5 and 7 give 16 + 25 = 41, which is below 49, so the largest angle is obtuse.
Diagonals, screen sizes and checking a square corner
A rectangle is two right triangles sharing the diagonal, so the theorem gives its diagonal directly: diagonal = √(length² + width²). A door frame 0.9 m wide and 2.1 m tall has a diagonal of √(0.81 + 4.41) = √5.22 = 2.28 m. If you measure both diagonals of a door frame and they differ, the frame is out of square.
Screens are sold by diagonal. A display with a 16:9 shape and a 55-inch diagonal has a width of 55 × 16 ÷ √(16² + 9²) = 55 × 16 ÷ 18.36 = 47.9 inches and a height of 55 × 9 ÷ 18.36 = 27.0 inches. The sum of the squares of those, 2,294 + 729, is 3,023, close to 55² = 3,025 and the difference is just rounding.
Wall measured
3 m
Second wall at the corner
4 m
Diagonal between marks
5.00 m
Is the corner square?
Yes, 3² + 4² = 5²
9 + 16 = 25 and 5² = 25. A diagonal longer than 5.00 m means the angle is wider than 90 degrees; shorter means it is narrower.
Builders scale the check up for accuracy: 6 m and 8 m on the walls with a 10 m diagonal. The longer the sides, the more a small misalignment shows.
Going to three dimensions
The same idea applies twice in a box. First find the diagonal of the floor, then use that as one leg of a vertical triangle with the height as the other. The result is the space diagonal: √(l² + w² + h²).
A box that is 40 cm by 30 cm by 120 cm has a floor diagonal of √(1,600 + 900) = 50 cm and a space diagonal of √(2,500 + 14,400) = √16,900 = 130 cm. A 125 cm rod would therefore fit diagonally, while a 135 cm one would not. Shipping and packing sometimes depend on exactly this.
Slips to avoid
- Using it on a triangle that has no right angle.
- Adding the legs and forgetting the square root.
- Subtracting in the wrong order when finding a leg.
- Treating a leg as the hypotenuse; the hypotenuse is always the longest side.
- Mixing units between the two legs.
A calculator that returns the hypotenuse or the missing leg is a quick way to confirm a hand calculation, and it handles the decimals when the result is not a whole number.
Common questions
What is 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². With legs 3 and 4, c² = 9 + 16 = 25, so c is 5.
How do I find the hypotenuse of a right triangle?
Square each leg, add the results, then take the square root. For legs of 9 and 12, that is 81 + 144 = 225, and √225 = 15. The hypotenuse is always the longest side of the triangle.
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. With a hypotenuse of 17 and a leg of 8, 289 − 64 = 225, so the other leg is 15.
Does the Pythagorean theorem work for any triangle?
No. It holds only when one angle is exactly 90 degrees. For other triangles you need the law of cosines, which includes a correction term, or you split the triangle into right-angled pieces.
What are Pythagorean triples?
They are sets of three whole numbers that satisfy a² + b² = c², such as 3-4-5, 5-12-13 and 8-15-17. Any multiple of a triple also works, so 6-8-10 and 9-12-15 are triples too.
Was this guide helpful?
Continue reading
View all blogsArea and Perimeter of a Rectangle, With Examples
A 12 m by 8 m rectangle has an area of 96 m² and a perimeter of 40 m. See which formula you need, and why mixing up the units is the usual error.
5 min read
Circle Area and Circumference: Formulas Explained
A circle with a 14 cm diameter has a circumference of 43.98 cm and an area of 153.94 cm². Learn the formulas and the radius-versus-diameter trap.
5 min read
How to Find the Area of a Triangle: 4 Methods
Half base times height gives a triangle's area, but it needs the perpendicular height. See how Heron's formula and ½ab sin C solve the other cases.
5 min read




