Skip to content
Calc.

Pythagorean Theorem Calculator

Solve a right triangle with a² + b² = c². Enter any two sides and leave the third blank: it finds the hypotenuse or a missing leg, or checks all three.

Last updated: October 2026

Missing side (the one you left blank)

5 units

Formula below · 2 sources (mathworld.wolfram.com, khanacademy.org) · Updated Oct 2026

Compare with similar

About this calculator

In a right triangle, the square of the hypotenuse (the side opposite the 90° angle) equals the sum of the squares of the two legs:

a² + b² = c²

Rearranged, that gives each side from the other two:

c = √(a² + b²) a = √(c² − b²) b = √(c² − a²)

Fill in two sides and leave the third blank; the calculator solves for the blank one. The defaults, legs 3 and 4, give c = √(9 + 16) = √25 = 5. If you fill in all three, it checks whether they make a right triangle (allowing a 0.01% rounding difference). Answers are rounded to 2 decimal places.

Checks and limits

The hypotenuse is always the longest side, so when you solve for a leg, c must be longer than the leg you entered. Use the same unit for every side. The theorem only holds for right triangles; for other triangles use the law of cosines, c² = a² + b² − 2ab·cos C, which reduces to a² + b² = c² when C = 90°.

Whole-number solutions such as 3-4-5, 5-12-13 and 8-15-17 are called Pythagorean triples. Builders use 3-4-5 (or 6-8-10) to lay out a square corner without measuring the angle.

Common Pythagorean triples
Leg aLeg bHypotenuse c
345
51213
81517
72425
202129
94041

How to use

Leave the side you want to find blank and enter the other two. Example 1 (hypotenuse): legs 3 and 4, hypotenuse blank. c = √(3² + 4²) = √25 = 5. Example 2 (missing leg): clear Leg a, enter b = 12 and c = 13. a = √(13² − 12²) = √25 = 5. Example 3 (not a triple): legs 1 and 1. c = √2 ≈ 1.41. Example 4 (check): a = 6, b = 8, c = 10. 36 + 64 = 100 = 10², so it is a right triangle.

Frequently asked questions

How do I find the hypotenuse?

Square both legs, add them, and take the square root: c = √(a² + b²). Legs of 5 and 12 give √(25 + 144) = √169 = 13.

How do I find a missing leg?

Subtract the square of the known leg from the square of the hypotenuse and take the square root: a = √(c² − b²). With c = 10 and b = 6, a = √(100 − 36) = √64 = 8. On this page, clear the leg you want and enter the other two sides.

How can I tell which side is the hypotenuse?

It is the side across from the right angle and always the longest of the three. If a 'leg' you entered is longer than the hypotenuse, the numbers cannot form a right triangle.

Does the Pythagorean theorem work for every triangle?

No, only for right triangles. For any triangle, the law of cosines c² = a² + b² − 2ab·cos C applies; when C is 90°, cos C = 0 and it becomes a² + b² = c².

What are Pythagorean triples?

Sets of three whole numbers that satisfy a² + b² = c², such as 3-4-5, 5-12-13, 8-15-17 and 7-24-25. Any multiple of a triple, like 6-8-10, is also a triple.

Related calculators

Sources & references

Think a result is wrong? Report a problem with this calculator.