Pythagorean Theorem Calculator

Use this theorem only for right triangles. The hypotenuse is always opposite the 90-degree angle and must be the longest side.

The theorem, in plain terms

For any right triangle, the square of the hypotenuse (the longest side, opposite the right angle) equals the sum of the squares of the other two sides: a² + b² = c². Given any two sides, the third follows directly — add or subtract the squares, then take the square root.

Why it only works for right triangles

The Pythagorean theorem is a special case of the more general law of cosines, which applies to any triangle. When the angle between two sides happens to be exactly 90°, the cosine term in that general formula drops to zero, leaving exactly a²+b²=c².

The hypotenuse is always the longest side and is always opposite the right angle. If you're solving for a leg (a or b) rather than the hypotenuse, make sure the known hypotenuse value is actually longer than the known leg — otherwise no valid triangle exists.
3453² + 4² = 5²9 + 16 = 25
The Pythagorean theorem applies to right triangles only.

Worked example: understanding the calculation

When the legs are 6 and 8, the hypotenuse is √(36 + 64) = 10. If the hypotenuse is 10 and one leg is 6, the missing leg is √(100 − 36) = 8.

Related tools

For triangle angles and general cases, see the Triangle Calculator. For shape area, use the Area Calculator.

A worked example

In a right triangle with legs of 3 and 4, the hypotenuse is c = √(3² + 4²) = √25 = 5. Solving for a leg works the same way: with a hypotenuse of 13 and one leg of 5, the other leg is √(13² − 5²) = √144 = 12. Leave the unknown side blank and the calculator fills it in.

Tips for right triangles

The theorem only works if one angle is exactly 90°. A quick way to check a corner is the 3-4-5 rule: if the sides measure 3, 4 and 5 units, the corner is square, and builders use multiples such as 6-8-10. The hypotenuse is always the longest side, so if your answer for a leg is larger than the hypotenuse, the numbers were entered the wrong way round.

You might also need: Square Footage Calculator, Area Calculator, Triangle Calculator, Circle Calculator.

What next? If you also need the angles, area or height of the triangle, the Right Triangle Calculator works them all out from any two values. When your two legs come from points on a graph, the Slope Calculator gives the rise, run, angle and distance, and the Distance Calculator handles 3D points and places on a map.

Common questions

What's a "Pythagorean triple"?

A set of three whole numbers that satisfy a²+b²=c² exactly, like 3-4-5 or 5-12-13. They're useful as quick mental-math reference points and show up often in textbook problems.

Can this be used for non-right triangles?

No — for any triangle without a 90° angle, use the law of cosines instead, which is exactly what our Triangle Calculator does.

More Math Calculators

Pick another tool to jump straight to it.