Geometry

Pythagorean theorem calculator

Calculate the hypotenuse or a missing leg of a right triangle and review the formula step by step.

Triangle inputs

Use the same unit for every side of the right triangle.

Quick examples

Pending

Enter two lengths

The result will appear here with the formula and check.

Leg a
Leg b
Hipotenusa

Show calculation

Formula: Complete the fields to see the formula.

Substitution:

Calculation:

Result:

Check

Triangle diagram

The highlighted side is hypotenuse c.

Not to scale

Right triangle with legs a and b and hypotenuse c Leg a is horizontal, leg b is vertical and hypotenuse c is opposite the right angle. b a c 90°

The hypotenuse is always opposite the right angle and is the longest side. The diagram only identifies the sides.

Publicidad

How the theorem works

In a right triangle, the legs form the 90° angle. The hypotenuse is opposite that angle.

Base formula

The relationship is a² + b² = c². If you know two sides, you can solve for the third.

For the hypotenuse

Add the squares of both legs and take the square root: c = √(a² + b²).

For a missing leg

Subtract the square of the known leg from the square of the hypotenuse: b = √(c² - a²).

Solved examples

These examples show the same steps generated by the calculator.

Legs of 3 cm and 4 cm

c = √(3² + 4²) = √25 = 5 cm. This is one of the most common Pythagorean triples.

Hypotenuse 13 m and leg 5 m

b = √(13² - 5²) = √144 = 12 m. The hypotenuse must be longer than the known leg.

Continue with area and perimeter

Once you know all three sides, use those values to calculate the triangle’s area and perimeter.

Open the area and perimeter calculator

Frequently asked questions

What is the Pythagorean theorem?

It is a relationship for right triangles: the sum of the squares of the legs equals the square of the hypotenuse.

How do I calculate the hypotenuse?

Square each leg, add the values and take the square root. The formula is c = √(a² + b²).

How do I calculate a missing leg?

Subtract the square of the known leg from the square of the hypotenuse and take the square root. This calculator uses b = √(c² - a²).

What is the hypotenuse of a triangle with legs 3 and 4?

The hypotenuse is 5 because 3² + 4² = 9 + 16 = 25 and √25 = 5.

Does the Pythagorean theorem work for any triangle?

No. It applies only to right triangles, meaning triangles with a 90° angle.

Why must the hypotenuse be the longest side?

Because it is opposite the right angle. In a right triangle, it is always longer than either leg.