Pythagorean Theorem Calculator

Enter any two sides of a right triangle and leave the unknown blank. With both legs, it finds the hypotenuse; with one leg and the hypotenuse, it finds the missing leg — all from a² + b² = c².

Enter two sides and press Calculate.

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:

theorem: a² + b² =hypotenuse: c = √( a² + b² ) missing leg: a = √( c² − b² ) area: A = ½ · a · b

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:

Square the legs: 6² = 36 and 8² = 64.
Add them: 36 + 64 = 100.
Hypotenuse: √100 = 10.
Area: ½ × 6 × 8 = 24 square units.

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.

Note: classic whole-number sets like 3-4-5, 5-12-13 and 8-15-17 are called Pythagorean triples — handy because they give exact right triangles with no rounding.

Frequently asked questions

What is the Pythagorean theorem?

In any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c², where c is the hypotenuse — the side opposite the right angle.

How do I find the hypotenuse?

Square both legs, add them and take the square root: c = √(a² + b²). For legs of 6 and 8 the hypotenuse is √(36 + 64) = √100 = 10.

How do I find a missing leg?

Rearrange the theorem: a = √(c² − b²). The hypotenuse must be longer than the known leg, otherwise the triangle is impossible. Leave the leg blank, fill in the other leg and the hypotenuse, and the calculator solves for it.

What is the area of the right triangle?

For a right triangle the two legs are the base and height, so the area is ½ × a × b. With legs 6 and 8 the area is ½ × 6 × 8 = 24 square units.

MB
Mustafa Bilgic · Editor, Calcool
The Pythagorean theorem is one of the oldest results in Euclidean geometry, as described in references such as the Wolfram MathWorld entry on the Pythagorean Theorem. All computation runs in your browser. Last updated 20 June 2026.

Related calculators