Skip to content

Pythagorean theorem: formula and examples

Updated on June 30, 2026 · by Rafael Rossi

The Pythagorean theorem applies to right triangles (with a 90° angle) and links the three sides: the square of the hypotenuse equals the sum of the squares of the legs.

The formula

a² + b² = c²

Where c is the hypotenuse (the longest side, opposite the right angle) and a, b are the legs.

Find the hypotenuse

Legs 3 and 4: c = √(9 + 16) = √25 = 5 — the famous 3-4-5 triangle.

Find a leg

Rearranged: b = √(c² − a²). Hypotenuse 13, leg 5 → b = √(169 − 25) = √144 = 12 (the 5-12-13 triple).

Practical uses

  • Squaring corners: builders use the 3-4-5 rule for a 90° corner.
  • Straight-line distance between two points.
  • Diagonals: of a TV, a lot, a room.

FAQ

Does it work for any triangle? No, only right triangles. For others, use the law of cosines.

How to spot the hypotenuse? Always the side opposite the right angle, and the longest of the three.

Open the calculator: Pythagorean theorem →