1. Home
  2. Geometry
  3. Pythagorean Theorem Calculator
Geometry

Pythagorean Theorem Calculator

Find the hypotenuse of a right triangle from its two perpendicular sides.

Your numbers

units
units

Results update as you type. Nothing you enter is sent anywhere.

Result

5 units

Hypotenuse opposite the right angle; legs 3 and 4 in the same unit.

Formula used

c = √(a² + b²)

Give this calculator the two shorter sides of a right triangle and it returns the hypotenuse, the side opposite the 90-degree angle, using c = √(a² + b²). It helps with homework, ladder and ramp lengths, screen diagonals, and checking whether a corner is square. The answer is in whatever unit you used for the two sides.

How to use the Pythagorean Theorem calculator

  1. Measure the two sides that meet at the right angle, called the legs.
  2. Enter one leg in Side a and the other in Side b, using the same unit for both.
  3. Read the hypotenuse, rounded to six decimal places, in the same unit.
  4. If you already know the hypotenuse and need a missing leg, use the rearranged formula described below instead.

How the pythagorean theorem calculation works

Formulac = √(a² + b²)

Which sides go in which box

Side a and Side b must be the two legs, the sides that form the square corner. The order does not matter, because a² + b² is the same either way. The hypotenuse is always the longest side, so a result shorter than either input means something went wrong with the measurement.

The calculator only solves for the hypotenuse. To find a missing leg, rearrange to a = √(c² − b²). For a 13-foot ladder whose base sits 5 feet from a wall, the height reached is √(169 − 25) = √144 = 12 feet. You can work that out with the Scientific Calculator by typing sqrt(13^2 - 5^2).

Checking a corner for square

Builders use the theorem in reverse to test whether a corner is 90 degrees. Measure 3 units along one edge and 4 units along the other, then measure the diagonal between those marks. If it is exactly 5 units, the corner is square, because 3² + 4² = 9 + 16 = 25 = 5².

Scaling the triangle up improves accuracy on large layouts. Using 6, 8 and 10 feet, or 9, 12 and 15 feet, keeps the same proportions while reducing the effect of a small tape-reading error. If the diagonal comes out long, the angle is wider than 90 degrees; if short, it is narrower.

Worked examples

Diagonal of a 9 by 12 foot floor

Side a: 9 units · Side b: 12 units

  1. Square each leg: 9² = 81 and 12² = 144.
  2. Add the squares: 81 + 144 = 225.
  3. Take the square root: √225 = 15.
  4. The diagonal is 15 feet, a scaled-up 3-4-5 triangle.

Result: 15 units

A ramp with a 5-foot run and 7-foot rise

Side a: 5 units · Side b: 7 units

  1. Square each leg: 5² = 25 and 7² = 49.
  2. Add: 25 + 49 = 74.
  3. √74 = 8.6023…, which the calculator shows as 8.602325.
  4. The sloped surface is about 8.6 feet long.

Result: 8.602325 units

Assumptions and limits

Only right triangles with positive side lengths in matching units.

Formula and worked examples last checked November 20, 2026. Spotted a problem? Report an error.

Frequently asked questions

Does the Pythagorean theorem work for every triangle?

No. It holds only when one angle is exactly 90 degrees. For other triangles you need the law of cosines, c² = a² + b² − 2ab·cos(C), which reduces to the Pythagorean theorem when C is 90 degrees because cos 90° = 0.

What are Pythagorean triples?

They are whole-number side sets that satisfy a² + b² = c² exactly, such as 3-4-5, 5-12-13, 8-15-17 and 7-24-25. Any multiple of a triple, such as 6-8-10, is also a triple.

How do I find the diagonal of a TV screen?

Treat the width and height as the two legs. A screen 48 inches wide and 27 inches tall has a diagonal of √(48² + 27²) = √3,033 ≈ 55.07 inches.

Can I mix feet and inches?

Not directly. Convert both sides to one unit first, for example 4 feet 6 inches becomes 54 inches or 4.5 feet. The result comes back in the same unit you chose.