Pythagorean Theorem Calculator: Find the Hypotenuse or a Missing Side

Solve any right triangle with a² + b² = c². Find the hypotenuse or a missing leg, plus angles, area and perimeter, with the working shown.

Updated November 2026 · Free, no signup · Educational estimate, not professional advice

Pythagorean theorem calculator

This free Pythagorean theorem calculator solves any right triangle in one step. Enter the two legs to find the hypotenuse, or enter the hypotenuse and one leg to find the missing side. Along with the answer you get both acute angles, the area, the perimeter and the height to the hypotenuse, plus the full working of a² + b² = c² so you can copy the steps into homework or check a measurement on a job site. If all three sides come out as whole numbers, the calculator tells you that you have found a Pythagorean triple.

How to use the Pythagorean theorem calculator

  1. Choose what to solve for: the hypotenuse c, or one of the legs a or b.
  2. Enter the two sides you know. The hypotenuse is always the longest side, opposite the right angle.
  3. Pick a unit if you want it shown in the answer. The math is the same for any unit, as long as all sides use the same one.
  4. Choose how many decimal places to round to, then press calculate.

The Pythagorean theorem formula

The Pythagorean theorem says that in any right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides:

a² + b² = c²

Here a and b are the legs, the two sides that meet at the 90 degree angle, and c is the hypotenuse, the side across from the right angle. Rearranging the equation gives a formula for each side:

To findFormulaExample
Hypotenuse cc = √(a² + b²)a = 6, b = 8: c = √100 = 10
Leg aa = √(c² - b²)c = 13, b = 12: a = √25 = 5
Leg bb = √(c² - a²)c = 17, a = 8: b = √225 = 15

The theorem only works for right triangles. For other triangles, use the law of cosines, c² = a² + b² - 2ab cos(C), which reduces to the Pythagorean theorem when angle C is 90 degrees because cos 90° = 0.

Worked examples

Example 1: find the hypotenuse

A right triangle has legs of 5 cm and 12 cm. Square each leg: 25 and 144. Add them: 169. Take the square root: c = 13 cm. Because all three sides are whole numbers, 5, 12, 13 is a Pythagorean triple.

Example 2: find a missing leg

A 15 ft ladder leans against a wall with its foot 4 ft from the wall. How high up the wall does it reach? The ladder is the hypotenuse, so the height is √(15² - 4²) = √(225 - 16) = √209 = 14.46 ft.

Example 3: a TV screen diagonal

Screens are sold by their diagonal. A 16:9 television that is 47.9 inches wide and 27 inches tall has a diagonal of √(47.9² + 27²) = √(2,294.4 + 729) = √3,023.4 = 55.0 inches, so it is a 55 inch TV.

Example 4: distance between two points

On a coordinate grid, the distance between (1, 2) and (7, 10) is the hypotenuse of a triangle whose legs are the horizontal change (6) and the vertical change (8). The distance is √(36 + 64) = 10. This is the distance formula, d = √((x₂ - x₁)² + (y₂ - y₁)²), and it is just the Pythagorean theorem in disguise. The slope calculator uses the same idea to find the distance between two points.

Common Pythagorean triples

A Pythagorean triple is a set of three whole numbers that satisfy a² + b² = c². Knowing the common ones saves time on tests and in the field. Any multiple of a triple is also a triple, so 3-4-5 gives 6-8-10, 9-12-15 and 30-40-50.

abcCheck
3459 + 16 = 25
5121325 + 144 = 169
8151764 + 225 = 289
7242549 + 576 = 625
202129400 + 441 = 841
9404181 + 1,600 = 1,681
123537144 + 1,225 = 1,369
116061121 + 3,600 = 3,721

You can generate new primitive triples with Euclid's formula: pick whole numbers m > n > 0, then a = m² - n², b = 2mn and c = m² + n². With m = 4 and n = 1 you get 15, 8, 17.

Special right triangles

Two right triangles appear so often that it is worth memorizing their side ratios.

  • 45-45-90 triangle: the legs are equal and the hypotenuse is leg × √2 (about 1.414). A square with 10 inch sides has a diagonal of 14.14 inches.
  • 30-60-90 triangle: the sides are in the ratio 1 : √3 : 2. If the short leg is 5, the long leg is 8.66 and the hypotenuse is 10.

Real-world uses of the Pythagorean theorem

  • Construction and carpentry. Builders use the 3-4-5 rule to check that corners are square: measure 3 ft along one wall and 4 ft along the other, and the diagonal between the marks should be exactly 5 ft. For bigger layouts, use 6-8-10 or 9-12-15.
  • Roofing and stairs. The length of a rafter is the hypotenuse of the rise and the run. A roof that rises 6 ft over a 12 ft run needs rafters about 13.42 ft long before overhang. Stair stringers work the same way.
  • Ladders. Safety guidance places the foot of a ladder one quarter of its working length from the wall. A 20 ft ladder should sit 5 ft out and reaches about 19.4 ft high.
  • Screens and monitors. Diagonal size comes from width and height.
  • Navigation. Walking 3 miles east and 4 miles north puts you 5 miles from your start in a straight line.
  • Room layout. Checking whether a long sofa or panel will fit diagonally through a doorway or up a stairwell is a Pythagorean problem. For floor areas, combine it with the square footage calculator.

How to tell if a triangle is a right triangle

The converse of the theorem is also true: if the squares of the two shorter sides add up to the square of the longest side, the triangle has a right angle. Sides of 9, 12 and 15 give 81 + 144 = 225 = 15², so the triangle is right. If a² + b² is greater than c², the triangle is acute; if it is smaller, the triangle is obtuse. Sides of 6, 7 and 9 give 36 + 49 = 85, which is greater than 9² = 81, so that triangle is acute. Sides of 4, 5 and 7 give 16 + 25 = 41, less than 49, so that one is obtuse.

A short history and proof

The theorem is named after the Greek mathematician Pythagoras, who lived around 570-495 BC, but the relationship was known much earlier. A Babylonian clay tablet called Plimpton 322, written around 1800 BC, lists Pythagorean triples, and Indian and Chinese texts also describe it. One of the simplest proofs arranges four copies of the triangle inside a square with side a + b. The big square's area is (a + b)². It also equals the four triangles, 4 × ab/2 = 2ab, plus the tilted inner square c². Setting the two expressions equal gives a² + 2ab + b² = 2ab + c², and subtracting 2ab from both sides leaves a² + b² = c². Hundreds of other proofs exist, including one by US President James Garfield.

Once the Pythagorean theorem has given you all three sides, trigonometry gives you the angles. In a right triangle, sin α = a / c, cos α = b / c and tan α = a / b, where α is the angle opposite leg a. For the 3-4-5 triangle, tan α = 3 / 4, so α = arctan(0.75) = 36.87 degrees, and the other acute angle is 90 - 36.87 = 53.13 degrees. The calculator shows both angles automatically. The theorem is also behind the most important identity in trigonometry, sin²θ + cos²θ = 1, which you get by dividing a² + b² = c² by c².

Using the theorem on a scientific or graphing calculator

On a handheld calculator, type the expression in one line so you do not lose precision: √(5² + 12²) gives 13. On a TI-84, press 2nd then x² for the square root symbol, type 5 x² + 12 x², close the bracket and press enter. To find a leg, type √(13² - 5²). In Excel or Google Sheets, use =SQRT(A2^2+B2^2) for the hypotenuse and =SQRT(C2^2-B2^2) for a leg.

Common mistakes

  • Using the theorem on a triangle that is not right-angled.
  • Putting the hypotenuse in the wrong place. c is always the longest side, opposite the right angle.
  • Adding when you should subtract. To find a leg, subtract: a² = c² - b².
  • Forgetting the square root at the end.
  • Mixing units such as feet and inches in the same calculation.

For a slower, step-by-step walk-through with practice problems, read our guide on how to use the Pythagorean theorem.

About this calculator and your privacy

This calculator runs entirely in your web browser. The numbers you type are never sent to a server, stored or shared, and you do not need an account. Results update when you press the calculate button, and the reset button clears them. We review the formulas whenever published guidelines or tax figures change, and the page was last reviewed in November 2026. If you spot a number that looks wrong, or would like another feature added, please contact us and include your inputs so we can reproduce the issue. Remember that every calculator is a simplification of real life: treat the output as a starting point for planning and check important decisions with a qualified professional.

Frequently asked questions

What is the Pythagorean theorem?

In a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c².

How do you find the hypotenuse?

Square both legs, add them, and take the square root: c = √(a² + b²). With legs 6 and 8, c = √100 = 10.

How do you find a missing leg of a right triangle?

Subtract the square of the known leg from the square of the hypotenuse and take the square root: a = √(c² - b²).

Does the Pythagorean theorem work for all triangles?

No. It only works for right triangles. For other triangles use the law of cosines.

What is a Pythagorean triple?

A set of three whole numbers that satisfy a² + b² = c², such as 3-4-5, 5-12-13 and 8-15-17.

What is the 3-4-5 rule in construction?

Measure 3 units along one side and 4 units along the other. If the diagonal between the marks is 5 units, the corner is a perfect 90 degrees.

How do you know which side is the hypotenuse?

It is the longest side and lies directly opposite the right angle.

This Pythagorean theorem calculator is an educational tool. It applies to right triangles only; check measurements and rounding before using results for construction, navigation or exam answers.