How to use this Pythagorean theorem calculator
Choose whether to find the hypotenuse (the side opposite the right angle) from the two legs, or a missing leg from the other leg and the hypotenuse. Enter the lengths in any unit; the answer is in the same unit. You also get the area, perimeter and both acute angles, the working, and a flag when the sides form a whole-number Pythagorean triple.
The Pythagorean theorem
In a right triangle, a² + b² = c², where c is the hypotenuse. To find c take the square root of the sum of the squared legs; to find a leg subtract the square of the known leg from c² first. For legs of 3 and 4:
- a² + b² = c², so c = √(a² + b²) = √(9 + 16) = √25 = 5.
- Area = a × b ÷ 2 = 3 × 4 ÷ 2 = 6. Angle A = arctan(a ÷ b) = 36.869898°, angle B = 90° − A = 53.130102°.
With legs 3 and 4, the hypotenuse is √(3² + 4²) = 5.
Pythagorean triples
Sets of whole numbers that satisfy the theorem are Pythagorean triples. The best known are 3-4-5, 5-12-13, 8-15-17 and 7-24-25, and any multiple of a triple also works: 6-8-10. For legs 5 and 12 the hypotenuse is 13, and a leg of 6 with a hypotenuse of 10 leaves 8, a triple. Builders use 3-4-5 to check square corners.
Irrational results and angles
Most right triangles do not have whole-number sides. Two legs of 1 give a hypotenuse of 1.414214, the square root of 2. The angles follow from the ratio of the legs: angle A is arctan(a ÷ b). Related tools: the square root calculator and the exponent calculator.
Related calculators and converters
Pythagorean theorem calculator FAQ
What is the Pythagorean theorem?
In a right triangle the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c².
How do you find the hypotenuse?
Square both legs, add them and take the square root. For 3 and 4 the answer is 5.
How do you find a missing leg?
Subtract the square of the known leg from the square of the hypotenuse, then take the square root.
What is a Pythagorean triple?
Three whole numbers where a² + b² = c², such as 3-4-5 or 5-12-13.
Does it work for any triangle?
Only for right triangles. For other triangles use the law of cosines.
Can the hypotenuse be shorter than a leg?
No. It is always the longest side.