HomeMath › Pythagorean Theorem Calculator

Pythagorean Theorem Calculator

Finds the missing side of a right triangle from any two of the legs a, b and hypotenuse c using a² + b² = c², and reports the area, perimeter and acute angles.

When to use

You know two sides of a right triangle and need the third, or want to check whether three lengths form a right triangle.

Do not use when: The triangle is not right-angled (use triangle-solver) or you need the distance between coordinates (use distance-2d).

Formula

c = √(a² + b²); a = √(c² − b²); b = √(c² − a²); area = a·b/2; angle_a = atan(a/b), angle_b = atan(b/a)

Inputs

ParameterTypeUnitRequiredDescription
anumbernoFirst leg (a side adjacent to the right angle). Give any two of a, b, c. Range: > 0
bnumbernoSecond leg. Range: > 0
cnumbernoHypotenuse (the longest side, opposite the right angle). Range: > 0

Outputs

OutputTypeUnitDescription
side_anumberLength of leg a.
side_bnumberLength of leg b.
hypotenuse_cnumberLength of the hypotenuse.
solved_forstringWhich side was computed ('a', 'b' or 'c'), or a note that all three were given and consistent.
areanumbera × b / 2.
perimeternumbera + b + c.
angle_a_degreesnumber°atan(a / b) in degrees.
angle_b_degreesnumber°atan(b / a) in degrees; the two acute angles sum to 90°.

Example

a = 3, b = 4: {"a":3,"b":4}{"side_a":3,"side_b":4,"hypotenuse_c":5,"solved_for":"c","area":6,"perimeter":12,"angle_a_degrees":36.8699,"angle_b_degrees":53.1301}

a = 5, c = 13: {"a":5,"c":13}{"side_b":12,"solved_for":"b","area":30,"perimeter":30,"angle_a_degrees":22.6199}

GET https://tttkmbb.com/api/v1/calculate/pythagorean?a=3&b=4

Machine access

Sources

FAQ

What if I enter all three sides?

They are checked against a² + b² = c². Consistent values are returned unchanged; otherwise an error reports the hypotenuse the two legs imply.

Why must the hypotenuse be the longest side?

Since c² = a² + b², c is always longer than either leg. A leg equal to or longer than c gives a negative square and no real triangle.

Related calculators