Pythagorean theorem

Know two sides of a right triangle — we find the third. Solve for the hypotenuse or either leg.

The angle between a and b must be right. Hypotenuse c is always the longest side.

Input

Result

Choose which side to find and enter the two known lengths.

How it works

Pythagorean theorem: in a right triangle a² + b² = c², where c is opposite the right angle.

Solve for c: c = √(a² + b²). For a: a = √(c² − b²). Same idea for b.

Everyday use: screen diagonal, shortest path across a field, checking a right angle with a 3-4-5 board.

Formula

a² + b² = c²

c = √(a² + b²) ··· a = √(c² − b²) ··· b = √(c² − a²)

How to use this calculator

  1. Choose which side you need.
  2. Enter two known positive lengths.
  3. Read the result and the triangle sketch.
  4. Check that a² + b² ≈ c².

Examples

Example 1 — 3 and 4

  • a: 3
  • b: 4
  • Find c

c = 5

The most famous Pythagorean triple.

Example 2 — 5 and 12

  • a: 5
  • b: 12

c = 13

Another clean triple.

Example 3 — find a

  • b: 8
  • c: 10

a = 6

√(100 − 64) = √36 = 6.

Example 4 — find b

  • a: 6
  • c: 10

b = 8

The 6-8-10 triangle (double 3-4-5).

Frequently asked questions

Which side is the hypotenuse?

The longest one — opposite the right angle. If results look wrong, check you did not put a shorter side as c.

Why must c be longer than a and b?

Because c² = a² + b² is larger than either square alone. If c is shorter, you get a negative under the square root.

Only whole numbers?

No — any positive lengths work. Triples like 3-4-5 are just easy to check.

Why the sketch?

So you see which side is which. The scale follows your numbers.

Can I find a rectangle diagonal?

Yes — the sides are a and b, the diagonal is c. Same formula.

What if the triangle is not right-angled?

Pythagoras does not apply. Use the law of cosines instead.

Quick right-angle check on site?

Measure 3 and 4 on the arms; the diagonal should be 5.

Units?

Keep all sides in the same unit. The answer uses that unit too.

Related calculators