Geometry

Pythagorean Theorem Calculator

Find the hypotenuse of a right triangle from its two legs, or find a missing leg from the hypotenuse and the other leg.

The theorem

In a right triangle, a² + b² = c², where a and b are the two shorter sides (legs) and c is the longest side (the hypotenuse), opposite the right angle. Rearranged: c = √(a² + b²), a = √(c² − b²), and b = √(c² − a²).

Worked example

A right triangle with legs of 3 and 4 has a hypotenuse of √(3² + 4²) = √(9 + 16) = √25 = 5 — the classic 3-4-5 right triangle used throughout construction and geometry to check for a true right angle.

Common uses

  • Checking whether a corner is a true right angle using the 3-4-5 rule
  • Finding the diagonal distance across a rectangular space
  • Working out cable, ladder, or ramp lengths that span a height and a horizontal distance

Frequently asked questions

Does this work for any triangle?

No — the Pythagorean theorem only applies to right triangles (triangles with one 90° angle). For other triangles, a different method like the law of cosines is needed.

How is the 3-4-5 rule used on a job site?

Measure 3 units along one side from a corner and 4 units along the perpendicular side, then check that the diagonal between those two points measures exactly 5 units — if it does, the corner is a true 90°.

Related calculators