Guide

The Pythagorean theorem, with worked examples

Reviewed 23 November 2026 · 6 min read · Written and maintained by Toolnexo

The Pythagorean theorem is the rule that links the three sides of a right triangle, and it turns up in carpentry, screen sizes, maps and ladders as much as in school. This guide explains the rule, shows how to find any missing side, how to test whether a corner is square, and how to get the angles and area once you know the sides. The figures come from the Pythagorean theorem calculator on this site, which runs in your browser, so nothing you enter is uploaded.

The rule

A right triangle has one angle of exactly 90 degrees. The side across from it, the longest, is the hypotenuse, called c. The other two sides, the legs, are a and b. The theorem says that a² + b² = c². For legs of 3 and 4, 3² + 4² = 9 + 16 = 25, so c = √25 = 5.

Finding the hypotenuse

Square the two legs, add them and take the square root: c = √(a² + b²). The square with sides of 1 has a diagonal of √(1 + 1) = √2 = 1.414214, which is why that number turns up so often. A rectangle 6 wide and 8 long has a diagonal of √(36 + 64) = √100 = 10.

Finding a leg

Rearrange the rule: a = √(c² − b²). With c = 13 and b = 12, a = √(169 − 144) = √25 = 5. The hypotenuse must always be longer than either leg, so a value of c that is not larger than the known leg cannot belong to a right triangle. A hypotenuse of 4 with a leg of 5 is rejected by the calculator for that reason.

Pythagorean triples

Sets of three whole numbers that fit the rule are called Pythagorean triples. The best known are 3-4-5, 5-12-13, 8-15-17, 7-24-25 and 20-21-29. Multiplying a triple by any whole number gives another, so 6-8-10 and 9-12-15 also work. A set with no common factor, like 3-4-5, is called primitive.

Builders use the 3-4-5 shape to check a corner. Measure 6 feet along one wall and 8 feet along the other, and if the distance between the two marks is exactly 10 feet, the corner is square. Any multiple of the triple works, so a longer 9-12-15 check is more accurate on a big floor.

Testing for a right angle

If you know all three sides, square them and compare. For 5, 12 and 13 you get 25 + 144 = 169 = 13², so the angle is a right angle. For 5, 12 and 14 you get 169 on the left and 196 on the right, so the corner is not square. When a² + b² is less than c², as here, the angle across from c is larger than 90 degrees. When it is greater, the angle is smaller. The calculator reports the mismatch and tells you to clear one box to find the missing side instead.

Everyday uses

  • A ladder 5 metres long standing with its foot 1.5 metres from a wall reaches √(25 − 2.25) = √22.75 = 4.77 metres up the wall.
  • A 24-inch screen in the 16:9 shape is about 20.92 inches wide and 11.77 inches high, because the diagonal of a 16 by 9 rectangle is √(256 + 81) = √337 = 18.36 units, and 24 ÷ 18.36 = 1.307 scales the shape up.
  • The straight-line distance between the points (2, 1) and (7, 13) has legs of 5 and 12, so it is 13 units.
  • The diagonal across a rectangular field is shorter than walking along two sides, and the theorem tells you by how much.

Angles, area and the other measures

Once all three sides are known, the rest follows. In the 3-4-5 triangle, the area is 3 × 4 ÷ 2 = 6 and the perimeter is 12. The angle across from side a is arctan(3 ÷ 4) = 36.8699 degrees, and the other acute angle is 90 − 36.8699 = 53.1301 degrees. The height from the right angle down to the hypotenuse is a × b ÷ c = 12 ÷ 5 = 2.4, and the radius of the circle that fits inside is (a + b − c) ÷ 2 = 1.

The 5-12-13 triangle has an area of 30, a perimeter of 30, and angles of 22.6199 and 67.3801 degrees.

What the theorem does not cover

  • It works only for right triangles. For other triangles use the law of cosines, which includes the Pythagorean theorem as the special case of a 90-degree angle.
  • All sides must use the same unit. Convert first if one is in feet and another in inches.
  • The calculator rounds to six decimal places and accepts sides greater than zero. If you fill in all three sides, it accepts them only when they fit the rule apart from a tiny rounding error.
Tools in this guide

Put it into practice

How this guide is maintained

This page is reviewed when the related tools change. It describes what the published tools actually do: the tools run in your browser tab, so your files stay on your device. If you find something inaccurate, email [email protected] and it will be corrected.

Keep reading

Other guides

All guides →