Pythagorean Theorem Calculator
Find the hypotenuse or a missing leg of a right triangle using a² + b² = c².
What do you want to find?
Length of the missing side of the right triangle.
- 1
Square leg a
3² = 9 - 2
Square leg b
4² = 16 - 3
Sum of squares
9 + 16 = 25 - 4
Hypotenuse c
√25 = 5The square root of the summed squares gives the hypotenuse.
Formula
How this is calculated
This tool applies the Pythagorean theorem, which holds only for right triangles — triangles with one 90° angle. The two sides forming that angle are the legs (a and b); the side opposite it, always the longest, is the hypotenuse (c). The theorem states a² + b² = c², so each side relates to the others through their squared lengths, not their raw values.
In "hypotenuse" mode you enter the two legs. The calculator squares each leg, adds the squares, and takes the square root: c = √(a² + b²). In "leg" mode you enter the hypotenuse and one leg; it subtracts the leg's square from the hypotenuse's square and takes the root: a = √(c² − b²). All inputs share one consistent unit (cm, m, inches — whatever you choose), and the result carries that same unit.
Lengths must be non-negative. In leg mode the hypotenuse must exceed the known leg, otherwise the squared difference is negative and no real triangle exists. Results are shown to four decimals; many right triangles produce irrational sides that are rounded here.
Examples
| Input | Result |
|---|---|
| legs a = 3, b = 4 | hypotenuse c = 5 |
| hypotenuse c = 13, leg = 5 | missing leg = 12 |
About this calculator
The Pythagorean theorem relates the three sides of a right triangle: the square of the hypotenuse c equals the sum of the squares of the two legs a and b, written a² + b² = c². The hypotenuse is always the longest side, opposite the right angle.
You can rearrange the theorem to find any missing side. To get the hypotenuse from two legs, use c = √(a² + b²). To find a missing leg when you know the hypotenuse and the other leg, use a = √(c² − b²). For this to give a real result the hypotenuse must be longer than the known leg.
Frequently asked questions
For a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c².
Rearrange the theorem to a = √(c² − b²). Subtract the square of the known leg from the square of the hypotenuse, then take the square root.
Because c² equals a² + b², the hypotenuse squared is larger than either leg squared, so c is always greater than each leg in a valid right triangle.
Also known as
TG we-Calculate Editorial Team. (2026). Pythagorean Theorem Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/pythagorean-theorem-calculator
TG we-Calculate Editorial Team. "Pythagorean Theorem Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/pythagorean-theorem-calculator.
TG we-Calculate Editorial Team, "Pythagorean Theorem Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/pythagorean-theorem-calculator
@misc{wecalculate_pythagorean_theorem_calculator, title = {Pythagorean Theorem Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/pythagorean-theorem-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
