Hypotenuse Calculator (Pythagorean Theorem)

Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/3/2026

The Pythagorean theorem gives the hypotenuse of a right triangle with the formula √(a² + b²), where a and b are the two legs forming the right angle. For a 3-4 triangle, the hypotenuse is exactly 5.

Explanation

In a right triangle, the hypotenuse is the longest side, the one opposite the right angle. The Pythagorean theorem states that the square of the hypotenuse equals the sum of the squares of the other two sides (a² + b² = c²); you just need to take the square root of that sum to get its length. This result only holds for a genuinely right triangle, meaning one with a 90° angle. The "3-4-5" triangle in the example below is a well-known special case: all three sides are whole numbers, which makes it a handy way to check that an angle is square on a job site or a drawing. This calculator finds the hypotenuse from the other two sides; for the area of the same right triangle, the two legs forming the right angle serve directly as base and height in our triangle area calculator.

Example: a right triangle with legs of 3 cm and 4 cm

Inputs

First leg: 3 cm. Second leg: 4 cm.

Calculation

Square each leg and add them: 3² + 4² = 9 + 16 = 25. Then take the square root of that sum: √25 = 5.

Result

The hypotenuse of this right triangle is 5 cm.

Frequently asked questions

Does this formula work for a triangle that isn't right-angled?

No, the Pythagorean theorem only applies to right triangles, meaning ones with a 90° angle. For a general triangle, the relationship between the sides is different (the law of cosines).

How do I find a leg of the right angle if I know the hypotenuse?

In that case you subtract instead of adding: the missing leg equals √(hypotenuse² − other leg²). This calculator is set up for the most common use (finding the hypotenuse from the other two sides) and doesn't cover this reverse direction.

Why is the 3-4-5 triangle such a common example?

Because it's the smallest set of whole numbers that exactly satisfies the Pythagorean theorem (3² + 4² = 5²). Builders have used it since antiquity to lay out a right angle with a simple 12-knot rope, without any angle-measuring tool.

Do the units of the two legs need to match?

Yes, both legs must be expressed in the same unit (for example, both in cm) for the result to be correct. Convert beforehand if needed.

Related resources

Similar calculators