Skip to content

Pythagorean theorem calculator

Find the hypotenuse or a leg of a right triangle (a² + b² = c²).

Hypotenuse c
5
25
Guide Pythagorean theorem: formula and examples

How the calculation works

The Pythagorean theorem applies to right triangles (those with a 90° angle). It links the three sides: the two legs (forming the right angle) and the hypotenuse (the longest side, opposite the right angle).

a² + b² = c²  (c is the hypotenuse)

Depending on what's missing, isolate the side you need:

  • Hypotenuse: c = √(a² + b²)
  • Leg: b = √(c² − a²)

Step by step (legs 3 and 4)

  1. a² + b² = 9 + 16 = 25
  2. c = √25 = 5

This is the famous 3-4-5 triangle, used by builders to check a square (90°) corner.

Finding a leg

If the hypotenuse is 13 and a leg is 5: b = √(169 − 25) = √144 = 12. Another classic triple: 5-12-13.

Where it's used

Distance between two points, a ladder against a wall, the diagonal of a rectangle (TV, screen), ramps and roofs — whenever a right angle is involved.

Examples

  • Legs 6 and 8: c = √(36 + 64) = √100 = 10.
  • Hypotenuse 13, leg 5: other leg = √(169 − 25) = 12.

Frequently asked questions

What is a 3-4-5 triangle?

A classic right triangle: 3² + 4² = 5² (9 + 16 = 25). One of the whole-number "Pythagorean triples".

Does the theorem work for any triangle?

No. Only for right triangles (with a 90° angle). For others, use the law of cosines.

How do I know which side is the hypotenuse?

It is always the side opposite the right angle and the longest of the three. The legs are the two sides forming the 90° angle.

Related calculators

More Math calculators

See all →

Updated on June 18, 2026 · by Rafael Rossi · Methodology & sources