Geometry

Pythagorean Theorem Calculator

Solve a right triangle: find the hypotenuse from two legs, or a missing leg from one leg and the hypotenuse.

Hypotenuse

5

c = √(a² + b²). Legs of 3 and 4 give a hypotenuse of 5.

How it works

In any right triangle, the two shorter sides — the legs — and the longest side — the hypotenuse — obey a² + b² = c². That single relationship is enough to find whichever side you're missing.

Got both legs? The hypotenuse is √(a² + b²). Legs of 3 and 4 give a hypotenuse of 5, the most famous right triangle there is. Missing a leg instead? Rearrange to √(c² − a²): a leg of 5 with a hypotenuse of 13 leaves the other leg at 12.

The catch when solving for a leg is that the hypotenuse must be the longest side. If the known leg is as long as or longer than the hypotenuse, the triangle is impossible and the calculator returns a dash.

Frequently asked questions

Which side is the hypotenuse?

It's the side opposite the right angle, and always the longest of the three. The other two sides, the ones that meet at the right angle, are the legs.

Does the theorem work for any triangle?

Only right triangles, the ones with a 90-degree corner. For triangles without a right angle you'd need the law of cosines instead, which this tool doesn't cover.

Why did I get a dash when solving for a leg?

The known leg was longer than or equal to the hypotenuse you entered. Since the hypotenuse has to be the longest side, that combination can't exist, so there's no real leg length to return.