Pythagorean theorem calculator

The Pythagorean theorem says that in a right triangle, a² + b² = c², where c is the hypotenuse (the side opposite the right angle). Enter any two sides and this calculator finds the third, showing each step with the exact square-root answer and a decimal. For example, legs 3 and 4 give a hypotenuse of 5.

Find the answer

Whole numbers, negatives, decimals (2.5 or 2,5) and fractions (3/4) all work.

Your answer and each step will show here. Below is a worked example for 3 and 4.
Worked example

c = 5

Step by step

  1. Write the Pythagorean theorem

    In a right triangle, is the hypotenuse (the side opposite the right angle).

  2. Put in the two legs
  3. Square and add
  4. Take the square root

How the calculator works

  • Finding the hypotenuse: square both legs, add them, take the square root: .
  • Finding a leg: square the hypotenuse, subtract the square of the known leg, take the square root: .

When the result isn’t a whole number, you get the exact answer as a simplified radical and a decimal. For legs and : .

Worked example: finding a leg

A 10 ft ladder leans on a wall with its foot 6 ft from the wall. How high does it reach?

  1. ft

Pythagorean triples worth knowing

, , , , and any multiple of them, like .

Common mistakes

  • Adding when you should subtract: for a missing leg, subtract from .
  • Using it on a triangle without a right angle. For those, you need the law of cosines.
  • Calling the longest side a leg. The hypotenuse is always the longest side.

Where you’ll use it

  • Distance between two points: the distance from to is the hypotenuse of a triangle with legs 3 and 4, so it’s 5. The slope calculator uses the same two points for slope.
  • Screen sizes: a TV’s size is its diagonal. A screen 48 in wide and 27 in tall is about in.
  • Building and DIY: builders check a corner is square with a 3-4-5 triangle. If the diagonal of a 3 ft by 4 ft corner measures exactly 5 ft, the corner is 90°.

Is my triangle a right triangle?

Use the theorem in reverse. Square the two shorter sides and add them. If the sum equals the square of the longest side, the triangle has a right angle. If the sum is bigger, the largest angle is less than 90°. If it’s smaller, the largest angle is more than 90°.

Frequently asked questions

What is the Pythagorean theorem?

In a right triangle, the squares of the two legs add up to the square of the hypotenuse: .

How do I find the hypotenuse?

Square both legs, add them, and take the square root. For legs 3 and 4: .

How do I find a missing leg?

Subtract the square of the known leg from the square of the hypotenuse, then take the square root: .

Does the Pythagorean theorem work for every triangle?

No, only right triangles (one angle exactly 90°).