Pythagorean Theorem Calculator

Use this free online Pythagorean theorem calculator to find any missing side of a right triangle - the hypotenuse or either leg. Just choose what you want to solve for, enter the known side lengths, and get an instant, accurate result.


How to Use the Pythagorean Theorem Calculator

  1. Select what you want to "Solve for" - the hypotenuse (c), leg a, or leg b.
  2. Enter the known side lengths that appear (Side a, Side b, and/or Hypotenuse (c)) based on your selection.
  3. Click "Calculate" to compute the missing side.
  4. Review the result shown below the button.

What the Theorem Says

In any right-angled triangle, the square on the hypotenuse equals the sum of the squares on the other two sides. The hypotenuse, c, is always the side opposite the 90° angle and is always the longest side. The two shorter sides, a and b, are called legs, and it does not matter which one you label a.

The relationship was also known in ancient India: the Baudhayana Sulba Sutra, an early text on constructing fire altars, states it in terms of the diagonal of a rectangle. The calculator applies the rearranged formula for whichever side is missing and rounds the answer to three decimal places.

Worked Examples

  • Ladder against a wall: a 5 m ladder stands with its foot 1.5 m from the wall. How high does it reach? Solve for a leg with c = 5 and the other leg 1.5: √(25 − 2.25) = √22.75 = 4.77 m.
  • TV screen size: screens are sold by their diagonal. A panel 121.8 cm wide and 68.5 cm tall has a diagonal of √(121.8² + 68.5²) = 139.741 cm, which is about 55 inches.
  • Shortest path: walking 40 m along one edge of a rectangular field and 30 m along the next covers 70 m, while cutting straight across the field covers only √(40² + 30²) = 50 m.

Pythagorean Triples

Some right triangles have whole-number sides. These sets, called Pythagorean triples, are useful for checking answers and appear often in exam questions. Any multiple of a triple is also a triple, so 6-8-10 and 9-12-15 work just like 3-4-5.

abc (hypotenuse)Check
3459 + 16 = 25
5121325 + 144 = 169
8151764 + 225 = 289
7242549 + 576 = 625
202129400 + 441 = 841

Using It on Site: Checking a Right Angle

Masons and carpenters use the converse of the theorem to set out square corners. Mark 3 units along one wall line and 4 units along the other; if the diagonal between the marks measures exactly 5 units, the corner is 90°. For larger layouts use 6-8-10 or 9-12-15 to reduce measuring error. If the diagonal is longer than expected the angle is more than 90°, and if it is shorter the angle is less than 90°.

Keep all three sides in the same unit. The theorem only applies to right triangles; for other triangles, use the law of cosines.

Frequently Asked Questions

The calculator uses a² + b² = c². To solve for the hypotenuse it computes c = √(a² + b²); to solve for a leg it rearranges the formula, e.g. a = √(c² - b²) or b = √(c² - a²).

When solving for a leg, the hypotenuse (c) must be strictly greater than the known leg. If it isn't, the calculator shows "The hypotenuse (c) must be greater than side b" (or side a) instead of a result, since a right triangle would be impossible otherwise.

For side a = 3 and side b = 4, solving for the hypotenuse gives c = √(3² + 4²) = √25 = 5 - the classic 3-4-5 right triangle.

Square the longest side and compare it with the sum of the squares of the other two. If they are equal, the triangle has a right angle. For sides 9, 12 and 15: 81 + 144 = 225 = 15², so it is right-angled. If the longest side's square is larger, the triangle is obtuse; if smaller, all its angles are acute.

The diagonal splits the shape into two right triangles, so the diagonal is the hypotenuse. Enter the length and width as sides a and b. For a square of side s the diagonal is s × √2; a 1 m square has a diagonal of 1.414 m.
No ratings yet — be the first!
Rate this calculator:
Was this tool helpful?