Pythagorean Theorem Calculator

GEOMETRY
bac
Hypotenuse c
Leg a
Leg b
Hypotenuse c
Area
Perimeter

The Pythagorean theorem, solved both ways

In any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a squared plus b squared equals c squared. This calculator finds the hypotenuse from two legs, or a missing leg from the hypotenuse and the other leg, and also returns the area and perimeter.

The formulas

To find the hypotenuse: c = the square root of (a squared plus b squared). To find a leg: a = the square root of (c squared minus b squared). The hypotenuse is always the longest side and sits opposite the right angle.

When a leg does not exist

If you are solving for a leg and the hypotenuse is not longer than the known leg, no right triangle exists — the hypotenuse must be the largest side. The calculator flags this case.

Related geometry tools

For non-right triangles or area from three sides, use the triangle area calculator. For the straight-line distance between points, the distance formula calculator uses the same theorem.

Worked example

Legs of 3 and 4 give a hypotenuse of the square root of (9 + 16) = the square root of 25 = 5 — the famous 3-4-5 triangle, with area 6 and perimeter 12.

FAQ

Does it only work for right triangles?

Yes. The theorem holds only when one angle is exactly 90 degrees. For other triangles you need the law of cosines.

Which side is the hypotenuse?

Always the one opposite the right angle, and always the longest of the three sides.

Spotted an error or have a suggestion for this calculator? Let us know →
Scroll to Top

The calculators and tools on Formula Factory are provided for general guidance and informational purposes only. Results are estimates based on standard formulas and the values you enter — they do not constitute professional engineering, electrical, or architectural advice. Always verify calculations with a qualified professional before making decisions for any safety-critical, code-compliance, or commercial application. Formula Factory makes no representations or warranties as to the accuracy or completeness of any result, and accepts no liability for errors, omissions, or any outcomes arising from reliance on this information.