Pythagorean Theorem Calculator
Enter the two legs of a right triangle to get the hypotenuse √(a² + b²), plus the area and perimeter.
The hypotenuse is the longest side
It always sits opposite the right angle and is longer than either of the two legs you enter.
Right triangles only
The theorem holds only when the two legs meet at exactly 90°. Other triangles need the law of cosines instead.
What is the Pythagorean theorem?
The relationship between a right triangle's sides
The Pythagorean theorem states that in any right triangle the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c². The two shorter sides that meet at the right angle are the legs, a and b; the side opposite the right angle is the hypotenuse, c. Solving for the longest side gives c = √(a² + b²). This single relationship lets you find a triangle's diagonal from two perpendicular measurements, which is why it underpins everything from screen sizes to building square corners.
Enter leg a and leg b in any unit, and you get the hypotenuse, the area, and the perimeter all at once.
Square each leg, add the squares, and take the square root to get the hypotenuse. The area and perimeter follow directly from the legs and that hypotenuse.
c = √(a² + b²)For a right triangle the area is half the product of the two legs, (a × b) ÷ 2, because the legs are themselves the base and height. The perimeter is simply the sum of all three sides: a + b + c. With legs of 3 and 4 that is an area of 6 and a perimeter of 12.
Take the classic 3-4-5 triangle, with legs of 3 and 4 units.
Square the legs
3² = 9 and 4² = 16, so the sum of squares is 9 + 16 = 25.
Take the square root
√25 = 5, so the hypotenuse is exactly 5 units.
Area and perimeter
Area = (3 × 4) ÷ 2 = 6, and perimeter = 3 + 4 + 5 = 12 units.
The hypotenuse is always the longest of the three sides, so a quick sanity check is that your result should exceed both legs but be smaller than their sum. When the two legs are equal you get an isosceles right triangle, and the hypotenuse is exactly √2 (about 1.414) times a leg — a 1 and 1 triangle has a hypotenuse of roughly 1.414. Watch for Pythagorean triples, whole-number sets such as 3-4-5, 5-12-13, and 8-15-17 where the hypotenuse comes out perfectly clean; their multiples, like 6-8-10, are triples too. The area and perimeter put the same triangle in context: area tells you the surface enclosed, while perimeter is the total distance around all three sides.
The formula is exact, but it applies to one shape only.
Only valid for right triangles
The theorem assumes the two legs meet at a precise 90° angle. If your triangle has no right angle, c = √(a² + b²) does not describe any real side, and you need the law of cosines instead. The result is unit-agnostic — enter both legs in the same unit (cm, inches, metres) and the hypotenuse, area, and perimeter come back in that same unit and its square.