Hypotenuse c5
Leg a3
Leg b4

The formula

a2+b2=c2a^2 + b^2 = c^2
a — first leg (a side next to the right angle)
b — second leg
c — hypotenuse (the longest side)

How it works

The Pythagorean theorem links the three sides of a right-angled triangle: the square of the longest side equals the sum of the squares of the other two. Enter any two sides and the calculator finds the third — the hypotenuse or a missing leg.

FAQ

Which side is the hypotenuse?

The hypotenuse is the side opposite the right angle, and it is always the longest of the three. The other two shorter sides, which meet at the right angle, are the legs.

Why does solving for a leg sometimes give zero?

A leg must be shorter than the hypotenuse. If you enter a hypotenuse that is not larger than the other leg, no real triangle exists, so the calculator returns zero.

About the Pythagorean theorem calculator

This calculator uses the Pythagorean theorem to find a missing side of a right-angled triangle. The theorem is one of the oldest and most famous results in mathematics, and it only works for triangles that contain a 90-degree angle. Give it any two of the three sides and it returns the third, whether that is the long hypotenuse or one of the two shorter legs.

How to use it

Choose which side you want to find with the “Solve for” menu, then enter the two you know. To find the hypotenuse, type the two legs: legs of 3 and 4 give a hypotenuse of 5, the classic 3-4-5 triangle. To find a missing leg instead, pick Leg a or Leg b and enter the hypotenuse plus the other leg. Remember the hypotenuse must always be the largest side, or the triangle cannot exist.

The formula

The theorem states a2+b2=c2a^2 + b^2 = c^2, where aa and bb are the two legs and cc is the hypotenuse. To find the hypotenuse, take the square root of the sum of the squared legs: c=a2+b2c = \sqrt{a^2 + b^2}. To find a leg, rearrange to subtract instead: a=c2b2a = \sqrt{c^2 - b^2}. Because the sides are squared, doubling a triangle’s size doubles every side but keeps the same relationship.

Where it is used

The theorem is everywhere that right angles appear. Builders and carpenters use the 3-4-5 rule to check that corners are square, and surveyors use it to measure distances that cannot be walked in a straight line. It underlies the distance formula in coordinate geometry, navigation and computer graphics, where the straight-line gap between two points is found from their horizontal and vertical separation. Any diagonal — a TV screen, a ramp, a roof rafter — can be worked out the same way.