CalcWise All calculators

Shapes and algebra

Pythagorean theorem calculator

Know two sides of a right triangle? Find the third. Choose whether you are looking for the long side (the hypotenuse) or one of the shorter legs.

Press Calculate to see the answer and every step of the working.

How it works

In any right triangle (one with a 90° corner), the square on the longest side equals the two smaller squares added together. The longest side is the hypotenuse, always opposite the right angle. The other two are the legs.

To find the hypotenuse, square both legs, add them, and take the square root. To find a leg, square the hypotenuse, subtract the square of the leg you know, and take the square root. If you ever get a leg longer than the hypotenuse, something has gone wrong.

The formula

  • a² + b² = c²
  • Hypotenuse: c = √(a² + b²)
  • Leg: b = √(c² - a²)
  • Area of the right triangle = a x b ÷ 2

Worked example

A ladder leans against a wall. Its foot is 5 m from the wall and it reaches 12 m up. How long is the ladder? 5² + 12² = 25 + 144 = 169, and √169 = 13 m.

A 10 m ramp rises from a point 6 m along the ground. How high does it go? √(10² - 6²) = √(100 - 36) = √64 = 8 m.

Common questions

Does this work for any triangle?

Only right triangles. For other triangles you need the law of cosines, which includes the angle.

What is a Pythagorean triple?

Three whole numbers that fit a² + b² = c², like 3-4-5, 5-12-13 and 8-15-17. Any multiple works too, so 6-8-10 is also a triple.

How can I check whether a corner is square?

Builders measure 3 units along one side and 4 along the other. If the diagonal is exactly 5, the corner is a right angle.