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.
