The formula
The Pythagorean theorem links the three sides of a right triangle, where c is the hypotenuse (the side opposite the right angle) and a, b are the two legs:
Leave the unknown side blank. If only the two legs are given, the calculator finds the hypotenuse. If a leg and the hypotenuse are given, it rearranges to solve for the missing leg — provided the hypotenuse is longer than the known leg, otherwise no right triangle exists.
Worked example
For legs a = 6 and b = 8 with the hypotenuse left blank:
Why it only works for right triangles
The clean relationship a² + b² = c² holds only when the angle between the two legs is exactly 90°. For any other triangle you need the more general law of cosines, c² = a² + b² − 2ab·cos(C), which collapses to the Pythagorean theorem when C = 90° because cos(90°) = 0. That is also the test for a right triangle: if the longest side squared equals the sum of the other two squared, the triangle has a right angle.