Pythagorean Theorem Calculator

a² + b² = c². Solve for hypotenuse or missing leg of a right triangle.

Inputs

Result

Loading calculator…

How to use this calculator

  • Pick what to solve for.
  • Enter the two known sides.
  • Read the missing side, area, and perimeter.

About this calculator

The Pythagorean theorem: in a right triangle, a² + b² = c² where c is the hypotenuse (opposite the right angle). Enables solving for any unknown side given the other two. Common Pythagorean triples (integer solutions): 3-4-5, 5-12-13, 8-15-17, 7-24-25. Used everywhere: distance formula, screen diagonal, picture-hanging, surveying.

How it works — the formula

For a right triangle with legs a, b and hypotenuse c: c² = a² + b² Solve any side: c = √(a²+b²); a = √(c²−b²); b = √(c²−a²)

Pythagoras' theorem (~530 BC, but documented earlier in Babylonian and Indian mathematics) states that the square of the hypotenuse of a right triangle equals the sum of the squares of the other two sides. It works only for right (90°) triangles in Euclidean geometry; the law of cosines generalizes it to arbitrary triangles. The theorem underpins the Euclidean distance formula in 2D and 3D, and through Pythagorean triples (3-4-5, 5-12-13, 8-15-17) it produces integer-side right triangles useful in surveying, framing, and number theory.

Worked examples

Example 1
Classic 3-4-5 triple
Inputs:
a = 3, b = 4
Output:
c = √(9 + 16) = √25 = 5 (exact)
Example 2
Solve for a leg
Inputs:
c = 13, b = 5
Output:
a = √(169 − 25) = √144 = 12 (5-12-13 triple)
Example 3
Real-world distance
Inputs:
Property corner offset by 30 ft east, 40 ft north
Output:
Diagonal = √(900 + 1600) = √2500 = 50 ft

Limitations

  • Applies only to right triangles in flat (Euclidean) geometry; on a sphere or other curved surface the analogous formula is the spherical law of cosines.
  • For non-right triangles use the law of cosines: c² = a² + b² − 2ab·cos(C).
  • When inputs have measurement error, the resulting hypotenuse error scales as ~√2 of the leg error; check uncertainty for engineering use.
  • Floating-point hypotenuse computation can underflow/overflow for very large or small magnitudes; programming languages provide a "hypot()" function that avoids this.

Pythagorean computation is exact for integer Pythagorean triples; real measurements inherit measurement-tool tolerance.

Frequently asked

When does it apply?+
Only right triangles (one 90° angle). For non-right, use the law of cosines: c² = a² + b² − 2ab cos C.
Famous Pythagorean triples?+
3-4-5 (smallest), 5-12-13, 8-15-17, 7-24-25, 20-21-29. Multiples: 6-8-10, 9-12-15, etc.
Where does the proof come from?+
Many proofs exist (Euclid, Bhaskara, James Garfield). Most rely on rearranging triangles to compare areas.
TV diagonal?+
A 16:9 widescreen with 32" diagonal: width × height satisfy a² + b² = 32² and a/b = 16/9. Solving: ~28" × 16".
Generalizes to higher dimensions?+
Yes — distance in n-D = √(sum of squared coordinate differences). Underlies linear algebra norm.

Related calculators

More tools you might like

Hand-picked tools that pair well with this one — same audience, same intent.