The Pythagorean theorem says that in a right triangle, ( a^2 + b^2 = c^2 ), where a and b are the legs and c is the hypotenuse (the side opposite the right angle). So ( c = sqrt{a^2 + b^2} ) and ( a = sqrt{c^2 – b^2} ). Example: legs 3 and 4 give a hypotenuse of ( sqrt{9 + 16} = 5 ).
The Pythagorean theorem is probably the most famous result in mathematics, and one of the most useful: it turns any right angle into a way of measuring distance. This guide shows how to use it, why it’s true, the special whole-number cases, and where it turns up, from construction sites to the distance formula and calculus.
The formula
In a right triangle with legs a and b and hypotenuse c:
$$a^2 + b^2 = c^2$$
| To find | Formula |
|---|---|
| The hypotenuse | ( c = sqrt{a^2 + b^2} ) |
| A leg | ( a = sqrt{c^2 – b^2} ) |
The hypotenuse is always the longest side and is opposite the ( 90^circ ) angle.
Example 1: the hypotenuse
Legs 6 and 8: ( c = sqrt{36 + 64} = sqrt{100} = 10 ).
Example 2: a leg
Hypotenuse 13, one leg 5: ( b = sqrt{169 – 25} = sqrt{144} = 12 ).
Example 3: an exact answer
Legs 2 and 5: ( c = sqrt{4 + 25} = sqrt{29} approx 5.385 ). Leave it as ( sqrt{29} ) unless a decimal is asked for.
Example 4: a TV screen
A “55-inch” TV is measured along the diagonal. If the screen is 48 inches wide, its height is ( sqrt{55^2 – 48^2} = sqrt{3025 – 2304} = sqrt{721} approx 26.9 ) inches.
Example 5: a ladder
A 10 m ladder leans against a wall with its foot 6 m from the wall. It reaches ( sqrt{100 – 36} = 8 ) m up. If the foot slides out, how fast does the top slide down? That’s a related rates problem built on this same equation.
Pythagorean theorem calculator
Enter any two sides (leave the third blank) to get the missing side exactly, plus the angles and area.
Pythagorean Theorem
\(a^2 + b^2 = c^2\): enter any two sides of a right triangle (c is the hypotenuse) and leave the third blank.
The full-page Pythagorean theorem calculator has more examples.
Why it’s true: a visual proof
Draw a large square with side ( a + b ), and place four copies of the right triangle inside it, one in each corner, with their hypotenuses forming a tilted square in the middle.

- The big square’s area is ( (a + b)^2 = a^2 + 2ab + b^2 ).
- It’s also four triangles plus the tilted square: ( 4cdotfrac12ab + c^2 = 2ab + c^2 ).
Setting these equal: ( a^2 + 2ab + b^2 = 2ab + c^2 ), so ( a^2 + b^2 = c^2 ). There are hundreds of other proofs, including one by US President James Garfield.
Pythagorean triples
Whole numbers that satisfy ( a^2 + b^2 = c^2 ) are Pythagorean triples.
| 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 ) |
Any multiple of a triple is a triple: 6-8-10, 9-12-15, 10-24-26. Every triple can be generated from two whole numbers ( m > n ) as ( (m^2 – n^2, 2mn, m^2 + n^2) ); for example, ( m = 2 ), ( n = 1 ) gives 3-4-5.
The converse: testing for a right angle
If ( a^2 + b^2 = c^2 ) for the three sides of a triangle, then the triangle has a right angle. Also:

- However, if ( a^2 + b^2 > c^2 ) (c the longest side), the triangle is acute;
- if ( a^2 + b^2 < c^2 ), it’s obtuse.
Builders use this to square a corner: mark 3 m along one wall and 4 m along the other; if the diagonal is exactly 5 m, the corner is ( 90^circ ).
Example. Sides 9, 12, 16: ( 81 + 144 = 225 < 256 ), so the triangle is obtuse.
In three dimensions
The diagonal of a box with sides l, w and h is
$$d = sqrt{l^2 + w^2 + h^2}$$
(apply the theorem twice: across the base, then up). A 3 × 4 × 12 box has diagonal ( sqrt{9 + 16 + 144} = 13 ).
Where it leads
- The distance formula ( d = sqrt{(x_2 – x_1)^2 + (y_2 – y_1)^2} ) is the Pythagorean theorem on a grid; see distance and midpoint formula.
- Trigonometry: on the unit circle, it becomes ( sin^2theta + cos^2theta = 1 ), the most important trig identity.
- Special triangles: the 45-45-90 and 30-60-90 ratios come from it; see special right triangles.
- Non-right triangles: the law of cosines ( c^2 = a^2 + b^2 – 2abcos C ) extends it to any angle.
- Calculus: arc length, ( intsqrt{1 + (f’)^2},dx ), adds up tiny Pythagorean hypotenuses; see the arc length formula.
Common mistakes
- Using it on a non-right triangle.
- Putting the hypotenuse in the wrong place. c must be opposite the right angle.
- ( sqrt{a^2 + b^2} = a + b ). False: ( sqrt{9 + 16} = 5 ), not 7.
- Adding when finding a leg. For a leg, subtract: ( c^2 – b^2 ).
Practice problems
- Find c if ( a = 9 ) and ( b = 12 ).
- Find b if ( a = 8 ) and ( c = 17 ).
- Find c if ( a = 1 ) and ( b = 3 ) (exact).
- Is a triangle with sides 10, 24, 26 a right triangle?
- Is a triangle with sides 7, 8, 12 acute, right or obtuse?
- Find the diagonal of a 2 × 3 × 6 box.
Answers: (1) 15; (2) 15; (3) ( sqrt{10} ); (4) yes, since ( 100 + 576 = 676 ); (5) obtuse, since ( 49 + 64 = 113 < 144 ); (6) 7.
FAQ
What is the Pythagorean theorem?
In a right triangle, ( a^2 + b^2 = c^2 ): the squares of the two legs add up to the square of the hypotenuse.
How do you find the hypotenuse?
( c = sqrt{a^2 + b^2} ).
How do you find the length of a leg?
( a = sqrt{c^2 – b^2} ).
What is a Pythagorean triple?
Three whole numbers that satisfy ( a^2 + b^2 = c^2 ), such as 3, 4, 5.
Does the Pythagorean theorem work for all triangles?
No, only right triangles. For other triangles, however, use the law of cosines.
Further reading
- Pythagorean theorem (Wikipedia) — dozens of proofs, history and generalizations.
- Pythagorean triple (Wikipedia) — generating triples and their properties.
Calculators for this topic
Keep learning
Volume Formulas and Surface Area of 3D Shapes
Volume and surface area formulas for cubes, boxes, cylinders, cones, spheres and pyramids, why they work, unit conversions and examples.
Area Formulas for Every Shape (with Examples)
Area formulas for squares, rectangles, triangles, parallelograms, trapezoids, rhombuses, circles, sectors and ellipses, why each works, and worked examples.

