Pythagorean Theorem Calculator

Choose whether you are looking for the hypotenuse or a leg, enter the other sides and see the working.

Pythagorean Theorem Calculator

Your result will appear hereFill in the fields and press “Calculate”.

Formula

  • a² + b² = c²
  • c = √(a² + b²)
  • b = √(c² − a²)
  • a and b are the two legs that meet at the right angle
  • c is the hypotenuse, opposite the right angle

In a right triangle the square on the longest side equals the sum of the squares on the other two.

Worked examples

Legs 3 and 4

What do you want to find?
The hypotenuse (longest side)
Leg a
3
Leg b
4

Hypotenuse c

5

Sides a, b, c: 3, 4, 5

Area: 6

Perimeter: 12

Hypotenuse 13, one leg 5

What do you want to find?
A missing leg
Leg a
5
Hypotenuse c
13

Missing leg b

12

Sides a, b, c: 5, 12, 13

Area: 30

Perimeter: 30

How it works

In a right-angled triangle the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the other two sides. With legs 3 and 4 the hypotenuse is √(9 + 16) = 5. Going the other way, if you know the hypotenuse and one leg, the missing leg is √(c² − a²).

The calculator also reports the area (½ × a × b), the perimeter and the two acute angles, and tells you when the three sides are whole numbers, which makes them a Pythagorean triple such as 3-4-5 or 5-12-13. It checks that a leg is shorter than the hypotenuse, since the hypotenuse is always the longest side.

For triangles without a right angle use the Triangle Calculator, and for roots such as √50 see the Square Root Calculator. Shapes in three dimensions are handled by the Area and Volume Calculator.

Assumptions and limits

  • Applies to right triangles only, in flat (Euclidean) geometry.
  • All sides use the same unit.