Pythagorean Theorem Calculator

Find the missing side of a right triangle using the Pythagorean theorem. Enter any two of the three sides (a, b, c) — leave the side you want to solve for empty — and the calculator returns the value with step-by-step working.

Enter two sides

Leave exactly one field empty.

Enter two sides and press Solve.

The Pythagorean theorem

a² + b² = c²

In any right triangle, the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the two legs.

UnknownFormula
Hypotenuse cc = √(a² + b²)
Leg aa = √(c² − b²)
Leg bb = √(c² − a²)

Common Pythagorean triples

Integer triples that satisfy the theorem exactly:

  • 3, 4, 5
  • 5, 12, 13
  • 8, 15, 17
  • 7, 24, 25
  • 20, 21, 29
  • 9, 40, 41

Any multiple of a triple is also a valid triple (e.g. 6, 8, 10 from doubling 3, 4, 5).

Worked examples

Example 1 — Find the hypotenuse

a = 3, b = 4.

c = √(9 + 16) = √25 = 5.

c = 5

Example 2 — Find a leg

b = 12, c = 13.

a = √(169 − 144) = √25 = 5.

a = 5

Example 3 — Non-integer result

a = 2, b = 5.

c = √(4 + 25) = √29 ≈ 5.385.

c ≈ 5.385

Frequently asked questions

The hypotenuse is the longest side of a right triangle — the one opposite the 90° angle. In the theorem it is always denoted by c.

No. The Pythagorean theorem applies only to right triangles. For general triangles you need the law of cosines. Use the Triangle Calculator instead.

Check whether a² + b² = c² for the three sides (with c the longest). If the sum of the two smaller squared sides equals the largest squared side, the triangle is right-angled.