Skip to content

Pythagorean Theorem Calculator

Solve a right triangle for any side, hypotenuse from two legs, or one leg from the other and the hypotenuse.

What this solves

The Pythagorean theorem says a² + b² = c² for any right triangle, where c is the hypotenuse (the side opposite the right angle) and a, b are the two legs. Knowing two of the three sides, you can solve for the third.

The calculator handles all three cases. Pick which side you want to solve for, type in the other two, and the result appears in the matching box. The equation panel below shows the math worked out so you can copy it for homework or check that your inputs make sense.

Three problem types

Case 1: known both legs, find hypotenuse. Most common case in basic geometry. a = 3, b = 4 → c = √(9 + 16) = √25 = 5. The classic 3-4-5 triangle.

Case 2: known hypotenuse and one leg, find the other leg. Rearrange to a = √(c² − b²). The hypotenuse must be longer than either leg, otherwise the math goes complex (negative under the square root).

Case 3: same as case 2 but solving for the other leg. Symmetric to case 2.

When you’d actually use this

Beyond classroom geometry homework:

  • Construction: laying out a square corner. Mark 3 feet down one wall, 4 feet down the other, and the diagonal between the marks should measure exactly 5 feet. If it does, the corner is square. If not, adjust until it does.
  • Distance between two GPS points: latitude and longitude differences are the legs; straight-line distance is the hypotenuse (for short distances where Earth’s curvature doesn’t matter).
  • Diagonal of a screen or piece of furniture: a 16:9 monitor with a 27-inch diagonal has horizontal × vertical of about 23.5 × 13.2 inches.
  • TV size selection: convert “diagonal inches” to actual width and height of the screen.

Pythagorean triples (integer solutions)

Some right triangles have all-integer side lengths. The smallest are:

  • 3-4-5 (the famous one)
  • 5-12-13
  • 8-15-17
  • 7-24-25
  • 20-21-29
  • 9-40-41

Any multiple of these is also a triple, 6-8-10, 9-12-15, etc. are scaled-up 3-4-5 triangles. There are infinitely many primitive (non-multiple) triples; mathematicians have known how to generate them all since Euclid.

Common mistakes

The biggest one: the hypotenuse must be the LONGEST side. If you enter a hypotenuse smaller than one of the legs and try to solve, you’ll get an error or a complex result. Always sanity-check that c > a and c > b in any right triangle.

Second: the theorem only works on right triangles. For triangles without a 90° angle, you need the Law of Cosines instead: c² = a² + b² − 2ab·cos(C).

Third: be consistent with units. If a is in feet and b is in meters, you’ll get a meaningless hypotenuse.

Frequently asked questions

What if my triangle isn’t a right triangle? Pythagorean doesn’t apply. For oblique triangles, use the Law of Cosines (which generalizes Pythagorean for any angle) or the Law of Sines (which uses ratios of sides to sines of opposite angles).

Can I solve for an angle? Pythagorean alone doesn’t give angles, it only relates side lengths. For angles in a right triangle, use trigonometry: sin(angle) = opposite/hypotenuse, cos = adjacent/hypotenuse, tan = opposite/adjacent.

Why does the calculator show 4 decimal places? Most real-world Pythagorean answers are irrational. Square roots rarely come out to whole numbers. 4 decimals is precise enough for most engineering and homework purposes.

What about 3D? The 3D Pythagorean theorem is d² = x² + y² + z². For diagonal of a rectangular box, square each dimension, sum, take the square root. Same idea, one more term.

pythagorean theorem geometry right-triangle math

Related Tools

More in Math & Calculators