letmecalc

Pythagorean Theorem Calculator

The Pythagorean theorem states that in a right-angled triangle, the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the other two sides. Use this calculator to find the hypotenuse or a missing leg of a right triangle, along with its two acute angles.

Your numbers

Hypotenuse c
5
Leg a
3
Leg b
4
Angle A
36.87 °
Angle B
53.13 °

How to use the Pythagorean theorem

Choose which side you want to find. To find the hypotenuse, enter both legs: the calculator squares each one, adds the squares and takes the square root, c = √(a² + b²). To find a leg, enter the hypotenuse and the other leg: it subtracts the square of the known leg from the square of the hypotenuse and takes the square root, for example a = √(c² - b²). The box for the side you are solving is ignored. The hypotenuse must be longer than the known leg, otherwise no right triangle exists and the missing leg is shown as 0. Once all three sides are known, the angles follow from trigonometry: angle A, opposite leg a, is the inverse sine of a/c, and angle B is the inverse sine of b/c. The two always add up to 90°. Sides are rounded to four decimal places.

Formula
c² = a² + b² | a² = c² - b² | b² = c² - a² | Angle A = sin⁻¹(a / c)

Worked example. A right triangle with legs a = 3 and b = 4 has a hypotenuse of 5 (the classic 3-4-5 triangle), with angles of about 36.87° and 53.13°.

Worked example: how high will a ladder reach?

A 5 m ladder stands with its foot 1.5 m from a wall. The ladder is the hypotenuse, c = 5, and the distance from the wall is one leg, b = 1.5. The height it reaches is the other leg: a = √(5² - 1.5²) = √(25 - 2.25) = √22.75 ≈ 4.7697 m. The angle between the ladder and the ground is the angle opposite the height, sin⁻¹(4.7697 / 5) ≈ 72.54°. Ladder safety guidance commonly recommends about 75°, the "1 in 4" rule: one unit out for every four units up. For this 5 m ladder that means a foot about 1.21 m from the wall, which raises the top to about 4.85 m. Solving the same triangle with b = 1.21 confirms it.

Squaring corners and measuring diagonals

Builders use the theorem in reverse to check that a corner is a true right angle. Measure 3 units along one wall and 4 along the other; if the diagonal between those marks is exactly 5, the corner is square. Larger multiples are more accurate on site, such as 6-8-10 or 0.9 m, 1.2 m and 1.5 m. The same idea checks rectangles: a 12 ft by 16 ft room should measure 20 ft corner to corner, and if the two diagonals differ, the room is out of square. Screen sizes are diagonals too. A 55-inch screen with a 16:9 shape has a diagonal-to-width ratio of √(16² + 9²) / 16, giving a width of about 47.94 in and a height of about 26.96 in.

Pythagorean triples and when the theorem does not apply

Some right triangles have whole-number sides, called Pythagorean triples. The best known are 3-4-5, 5-12-13, 8-15-17 and 7-24-25, and any multiple of a triple, such as 6-8-10, is also one. They are handy for checking answers because the arithmetic comes out exact. The theorem only holds when one angle is exactly 90°. For any other triangle, use the law of cosines, c² = a² + b² - 2ab cos C, which reduces to the Pythagorean theorem when C = 90° because cos 90° = 0. Another frequent mistake is adding the sides before squaring: (3 + 4)² is 49, while 3² + 4² is 25. Square each leg separately, add, then take the root.

Questions people ask

What is the Pythagorean theorem?

In a right triangle the square of the longest side (the hypotenuse) equals the sum of the squares of the other two: a² + b² = c². With legs of 3 and 4, c² = 9 + 16 = 25, so the hypotenuse is 5. Whole-number sets like 3, 4, 5 and 5, 12, 13 are called Pythagorean triples.

What is the hypotenuse?

The hypotenuse is the longest side of a right triangle, always opposite the right angle (90°). It is what 'c' represents in the theorem.

Can this be used for 3D distances?

Yes. For the diagonal of a box, extend the formula to d = √(a² + b² + c²). A box 3 by 4 by 12 has a diagonal of √(9 + 16 + 144) = √169 = 13. You can also do it in two steps: find the diagonal of one face, then use it with the third edge.

Does the Pythagorean theorem work for triangles without a right angle?

No. It only applies to right triangles. For other triangles, use the law of cosines, c² = a² + b² - 2ab cos C.

How do I find the angles of a right triangle from its sides?

Use the inverse sine: the angle opposite leg a is sin⁻¹(a / c). For a 3-4-5 triangle, that is sin⁻¹(0.6) ≈ 36.87°, and the other acute angle is 90° - 36.87° = 53.13°.

Why does the calculator show 0 for the missing leg?

Because the hypotenuse you entered is not longer than the known leg. In a right triangle the hypotenuse is always the longest side, so c must be greater than a or b for a solution to exist.

Put this calculator on your site

Free to use on any site. Please keep the credit link.

<iframe
  id="letmecalc-pythagorean-calculator"
  src="https://letmecalc.com/embed/math/pythagorean-calculator"
  title="Pythagorean Theorem Calculator"
  width="100%"
  height="620"
  style="border:0;max-width:100%"
  loading="lazy"
></iframe>
<p><a href="https://letmecalc.com/math/pythagorean-calculator" target="_blank" rel="noopener">Pythagorean Theorem Calculator</a> by letmecalc</p>
<script>
(function () {
  var f = document.getElementById("letmecalc-pythagorean-calculator");
  window.addEventListener("message", function (e) {
    if (e.origin !== "https://letmecalc.com") return;
    if (!f || e.source !== f.contentWindow) return;
    var d = e.data;
    if (!d || d.source !== "letmecalc-embed" || d.type !== "resize") return;
    if (typeof d.height === "number" && d.height > 0) {
      f.style.height = d.height + "px";
    }
  });
})();
</script>