Calculate a side of a triangle with the Pythagorean theorem
Enter two known sides of a right triangle and find the third. Choose whether you want to calculate the hypotenuse or one of the legs.
No connection. Your numbers have been kept. Please try again.
No connection. Your numbers have been kept. Please try again.
Worked example
- Calculate: The hypotenuse
- Leg a: 3 m
- Leg b: 4 m
Result
Hypotenuse c
5 m
Working
- c = √(a² + b²)
√((3 m)² + (4 m)²) = 5 m
When can the Pythagorean theorem be used?
The Pythagorean theorem applies to a right triangle. The two sides that meet at the right angle are called legs. The side opposite the right angle is called the hypotenuse and is the longest side of the triangle. It is important to identify the sides before you enter the numbers.
Among other things, you can use the calculation to find the diagonal of a rectangle. The length and width of the rectangle are then the legs, and the diagonal is the hypotenuse. If the triangle does not have a right angle, this calculator cannot be used to find the missing side.
The formula for the hypotenuse and a leg
The relationship is a² + b² = c², where c is the hypotenuse. When both legs are known, the hypotenuse is found with c = √(a² + b²). The square root is taken after the sides have been squared and added together.
If you know the hypotenuse and one leg, a = √(c² − b²) is used. Here the square of the known leg is subtracted from the square of the hypotenuse. The hypotenuse must be longer than the leg for the result to be a triangle with a positive side length.
Example with sides of 3 m and 4 m
The legs are 3 m and 4 m. First calculate 3² = 9 and 4² = 16. The two numbers are added: 9 + 16 = 25. Then take the square root: √25 = 5. The full working is √(3² + 4²) = √(9 + 16) = √25 = 5 m.