Arvutaja

Pythagorean theorem calculator

The Pythagorean theorem says that in a right triangle the squares of the legs sum to the square of the hypotenuse: a² + b² = c². Two known sides give the third — and it only holds for right triangles.

Used when finding the hypotenuse.

Used when finding a leg. Must be longer than the leg.

The side you asked for
5
Working
c = √(a² + b²) = √(9 + 16) = √25 = 5
Perimeter
12
Area
6

Rates and thresholds

Hypotenuse
c = √(a² + b²)
Leg
a = √(c² − b²)
Best-known triple
3 – 4 – 5
Next triples
5 – 12 – 13, 8 – 15 – 17, 7 – 24 – 25
Diagonal of a square
side × √2 ≈ side × 1.4142

How do I find a side with the theorem?

For the hypotenuse, square both legs, add, and take the square root: with a = 3 and b = 4, c = √(9 + 16) = √25 = 5. For a leg, subtract the other leg's square from the hypotenuse's: with c = 13 and b = 5, a = √(169 − 25) = √144 = 12. The hypotenuse is always the longest side, opposite the right angle.

Does the theorem hold in every triangle?

No — only right triangles. Elsewhere the law of cosines governs: c² = a² + b² − 2ab·cos C, which collapses to Pythagoras at a right angle because cos 90° = 0. The converse holds too: sides satisfying a² + b² = c² guarantee a right triangle. That is exactly what a builder relies on when checking a corner with a 3-4-5 rope.

Why does the calculator say there is no such triangle?

Because the hypotenuse has to be longer than both legs — it sits opposite the right angle and is always the longest side. Enter a leg at or above the hypotenuse and the square root would take a negative number, so no such triangle exists. The usual cause is simply that c and b have been swapped.

What is the theorem used for in real life?

Builders check corners with it — the 3-4-5 rope triangle is an old trick. The same formula gives a television's diagonal, the ladder length a wall needs, and the shortcut across a rectangular lot. Any distance between two points from their coordinates is Pythagoras in disguise, so it is running inside your map app too.

Related calculators

All calculators