Pythagorean Theorem Calculator
Find the missing side of a right triangle from the other two: solve for the hypotenuse c, or for leg a or b.
Formula
c = √(a2 + b2) a = √(c2 − b2)
| Symbol | Meaning |
|---|---|
| a, b | The two legs (the sides that form the right angle) |
| c | The hypotenuse (the longest side, opposite the right angle) |
How to Use This Calculator
- Choose the Solve for (Hypotenuse c, Leg a, Leg b).
- Enter the Leg a.
- Enter the Leg b.
- Enter the Hypotenuse c when Solve for is Leg a or Leg b.
- Press Calculate. Results also update automatically as you type.
Worked Example
Using the values pre-filled in the calculator above:
| Solve for | Hypotenuse c |
|---|---|
| Leg a | 3 |
| Leg b | 4 |
| Missing side | 5 |
|---|---|
| Working | c = √(3² + 4²) = √25 |
| Area | 6 |
| Perimeter | 12 |
About This Calculation
The Pythagorean theorem states that in any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs. Although named after the Greek mathematician Pythagoras, the relationship was known to Babylonian and Indian mathematicians centuries earlier. It only applies to right triangles; for other triangles the law of cosines generalizes it.
Whole-number solutions are called Pythagorean triples. The best known is 3-4-5, and any multiple of it (6-8-10, 9-12-15) also works, as do 5-12-13 and 8-15-17. Builders use the 3-4-5 rule to check that a corner is square: measure 3 units along one wall and 4 along the other, and the diagonal should be exactly 5. When solving for a leg, the hypotenuse must be the longest side — if your numbers say otherwise, a measurement has been swapped or misread.
The theorem underpins the distance formula, so it is used whenever a straight-line distance is computed from horizontal and vertical offsets: screen sizes from width and height, ladder lengths against a wall, roof rafters, cable runs and navigation. For angles as well as sides, try the right triangle calculator.
Frequently Asked Questions
- Does the Pythagorean theorem work for all triangles?
- No, only for right triangles. For any other triangle use the law of cosines: c² = a² + b² − 2ab·cos(C), which reduces to Pythagoras when C = 90°.
- How can I tell if a triangle is a right triangle?
- Check whether the squares of the two shorter sides add up to the square of the longest. For 5, 12 and 13: 25 + 144 = 169 = 13², so it is a right triangle.
- Why is the answer an irrational number?
- Most square roots of whole numbers are irrational. With legs of 1 and 1, the hypotenuse is √2 ≈ 1.41421, which cannot be written exactly as a decimal or fraction.