Pythagorean Theorem Calculator

Work out a missing side of a right triangle. Choose whether you know both legs or the hypotenuse and one leg, enter the lengths, and the calculator returns the missing side along with the triangle's area and perimeter. Use any length unit, as long as every side uses the same one. Everything is calculated in your browser.

Inputs

Result

Hypotenuse c
5
Triangle area
6
Perimeter
12

How it is calculated

  1. Hypotenuse c = √(leg a ^ 2 + leg b ^ 2)
  2. Triangle area = leg a × leg b ÷ 2
  3. Perimeter = leg a + leg b + hypotenuse c

Resources for your next step

Helpful downloads

View all math & geometry downloads
Store coming soon

We are preparing practical spreadsheets, planners, and guides. Explore the store page for what is next.

What the theorem says

In a right triangle, the two sides that form the right angle are the legs, usually called a and b, and the longest side opposite the right angle is the hypotenuse, c. The Pythagorean theorem states that a² + b² = c². In words, the square of the hypotenuse equals the sum of the squares of the legs. It is true for every right triangle and only for right triangles.

The classic example has legs of 3 and 4. Squaring gives 9 and 16, which add to 25, and the square root of 25 is 5. So the hypotenuse is 5. This calculator starts with that example: enter your own legs to replace it.

Finding the hypotenuse

When you know both legs, square each one, add the squares, and take the square root: c = √(a² + b²). A ladder whose base is 6 feet from a wall and reaches 8 feet up the wall is √(36 + 64) = √100 = 10 feet long. The area of the triangle is half the product of the legs, and the perimeter is the sum of all three sides.

The answer is shown to six significant digits. Many hypotenuses are not whole numbers; legs of 1 and 1 give √2, about 1.41421. Keep the full value for further calculations and round only the final result to the precision your measurement supports.

Finding a missing leg

When you know the hypotenuse and one leg, subtract instead of adding: missing leg = √(c² − known leg²). With a hypotenuse of 13 and a leg of 5, the missing leg is √(169 − 25) = √144 = 12. The hypotenuse must be longer than the known leg. If it is not, no right triangle exists with those sides, and the calculator shows a message instead of a result.

This mode is handy for checking whether a corner is square. Measure 3 units along one wall and 4 along the other; if the diagonal between the marks is 5, the corner is a right angle. Builders scale the same 3-4-5 pattern up to 6-8-10 or 9-12-15 for larger layouts.

Units and accuracy

The theorem works in any length unit, but all sides must use the same one. If one leg is in feet and the other in inches, convert first with the length converter. The area result is in square units of whatever you entered, so legs in meters give an area in square meters.

Real measurements carry some error, and squaring magnifies small differences. If the result will be used to cut material, measure carefully, keep extra digits through the calculation, and allow for the width of the saw blade or joint. The calculator gives exact math for the numbers you enter; it cannot correct the measurements themselves.

Frequently asked questions

What is the Pythagorean theorem?

For a right triangle with legs a and b and hypotenuse c, a² + b² = c². The square of the longest side equals the sum of the squares of the other two.

How do I find the hypotenuse?

Square both legs, add them, and take the square root. Legs of 3 and 4 give √25, which is 5.

How do I find a missing leg?

Square the hypotenuse, subtract the square of the known leg, and take the square root. A hypotenuse of 13 and leg of 5 give 12.

Why do I get no result when finding a leg?

The hypotenuse must be longer than the known leg. If it is equal or shorter, no right triangle has those side lengths.

Does this work for triangles without a right angle?

No. The theorem applies only to right triangles. Other triangles need the law of cosines.

What units should I use?

Any length unit works, but every side must use the same one. The area comes out in that unit squared.

Sources

Results are calculated in your browser from the formulas shown and rounded for display. Check the inputs and the precision your task needs.

All math & geometry tools