Skip to content

Pythagorean Theorem Calculator

Find the hypotenuse from the two legs of a right triangle, or the missing leg from one leg and the hypotenuse; also get the area, perimeter and height to the hypotenuse.

Version 1

Things to keep in mind:

  • The theorem applies only to right triangles (one 90° angle); oblique triangles need the law of cosines.
  • If the hypotenuse is not longer than the known leg no triangle exists; the "valid triangle" output is 0 and the other results show 0.
  • Angles are not calculated; only side lengths, area, perimeter and height are given.

Calculator

Sides of the right triangle

What to find

Find the hypotenuse from the two legs, or the missing leg from one leg and the hypotenuse.

One of the two sides next to the right angle; use the same length unit for every value.

The other leg, in the same unit as a.

After the first calculation, the result updates automatically when you change a value.

Result

Enter the values and press Calculate to see the result here.

About this tool

The Pythagorean theorem states that in a right triangle the squares of the two legs add up to the square of the hypotenuse (the longest side): a² + b² = c². This tool solves both common questions.

Formulas

  • Hypotenuse: c = √(a² + b²)
  • Missing leg: b = √(c² − a²) (c must be longer than a)
  • Area: a × b / 2
  • Perimeter: a + b + c
  • Height to the hypotenuse: h = a × b / c

Example: with a = 3 and b = 4, c = √(9 + 16) = 5, the area is 6, the perimeter 12 and the height to the hypotenuse 2.4. Conversely, a = 5 and c = 13 give b = √(169 − 25) = 12 (the 5-12-13 triangle).

It is handy for ladder lengths, diagonal measurements, screen sizes, land distances and checking that corners are square on a building site. Enter every length in the same unit; the area is in that unit squared.

How to read the result: if "Valid triangle" is 1 the calculation is complete; if it is 0 (in missing-leg mode the hypotenuse is not longer than the leg entered) no triangle exists and the other results show 0. The hypotenuse is always the longest side. Area and height to the hypotenuse are read together with the perimeter in the same unit; area is in that unit squared. Because results are rounded to 4 decimals, roots such as √2 are approximate (a = 1 and b = 1 give c = 1.4142).

How to use

  1. Choose what to find: the hypotenuse or the missing leg.
  2. Enter the known sides in the same length unit (a and b, or a and c).
  3. Click Calculate to see the sides, area, perimeter and height.

Notes

Results are rounded HALF_UP to 4 decimals. Sides must be between 0.0001 and 1,000,000,000. Square roots are decimal approximations; integer triples such as 3-4-5 come out exact. No unit conversion is done: all sides must share one unit.

Frequently asked questions

5 questions
  1. In a right triangle the sum of the squares of the legs equals the square of the hypotenuse: a² + b² = c². The hypotenuse is the longest side, opposite the right angle.

Next step

Related tools to continue your calculation.

All tools in Math & Geometry