Pythagorean Theorem Calculator: Hypotenuse or Leg
Find a right triangle's hypotenuse from its two legs, or a missing leg from the hypotenuse and one leg — with exact simplified radicals and step-by-step work.
The Pythagorean theorem
For any right triangle — one containing a 90° angle — the two shorter sides (the legs, and ) and the longest side (the hypotenuse, , always opposite the right angle) satisfy:
Given any two of the three sides, this calculator solves for the third, two ways:
The right triangle's area follows directly from the two legs: .
Solving for the hypotenuse
Given both legs, square each one, add the squares, and take the square root:
Example: legs a = 6, b = 8
Since 100 is a perfect square, the hypotenuse comes out exactly whole — no radical needed.
Example: legs a = 1, b = 1
Here 2 has no perfect-square factor, so is already in simplest form — the calculator shows both the exact radical and its decimal approximation. Notably, the area is still an exact , even though the hypotenuse itself is irrational — area and hypotenuse are independent questions.
Solving for a missing leg
Given the hypotenuse and one leg, rearrange the theorem to isolate the other leg:
Example: hypotenuse c = 13, leg a = 5
This is the well-known 5-12-13 triple. The area is .
Pythagorean triples
A Pythagorean triple is a set of three positive integers satisfying exactly, so every side — and the hypotenuse — comes out whole. The smallest is:
| Triple | Check |
|---|---|
| (3, 4, 5) | 9 + 16 = 25 |
| (5, 12, 13) | 25 + 144 = 169 |
| (8, 15, 17) | 64 + 225 = 289 |
| (9, 40, 41) | 81 + 1600 = 1681 |
Any scaled multiple of a known triple — like (6, 8, 10), twice (3, 4, 5) — is also a valid triple.
Common mistakes
- Mixing up the hypotenuse with a leg. The hypotenuse is always the longest side and always opposite the right angle — plugging a leg's value in for (or vice versa) gives a nonsensical result.
- Writing . The theorem is about the SQUARES of the sides, not the sides themselves — legs 6 and 8 give a hypotenuse of 10, not 14.
- Applying it to a non-right triangle. only holds when the triangle has a genuine 90° angle. For any other triangle, use the Law of Cosines instead.
Where this shows up
- Distance between two points: the Distance Formula is this exact theorem applied to coordinates, treating the horizontal and vertical differences as the two legs.
- A square or rectangle's diagonal: the diagonal is the hypotenuse of a right triangle formed by two adjacent sides.
- Construction: builders check a corner is truly square using a 3-4-5 triangle — if three marks at those proportions form a closed triangle, the corner is exactly 90°.
The Pythagorean theorem is also the special case of the Law of Cosines when the included angle is exactly 90° (since makes the extra term vanish) — the same underlying relationship this calculator's Distance Formula and Simplify Radicals calculators build on.
Frequently asked questions
- What is the Pythagorean theorem?
- For any right triangle with legs and and hypotenuse (the side opposite the right angle, always the longest), . Given any two of the three sides, the theorem solves for the third.
- How do I find the hypotenuse from the two legs?
- Solve . For legs 6 and 8: exactly — a classic Pythagorean triple.
- How do I find a leg if I know the hypotenuse and the other leg?
- Rearrange to . For a hypotenuse of 13 and a known leg of 5: .
- Why must the hypotenuse be greater than the known leg?
- The hypotenuse is always the longest side of a right triangle — it's the one opposite the 90° angle. If the entered hypotenuse isn't strictly longer than the known leg, no right triangle can close, so c² − leg² would be zero or negative and there's no valid other leg to solve for.
- What does it mean when the answer is a simplified radical like 2√34?
- Not every pair of legs gives a whole-number result — most give an irrational hypotenuse. This calculator reports the exact value as a simplified radical (pulling out any perfect-square factor, e.g. since ) alongside a rounded decimal approximation.
- What are Pythagorean triples?
- Sets of three positive integers that satisfy a² + b² = c² exactly, so every side comes out whole with no radical involved. The smallest is (3, 4, 5); others include (5, 12, 13), (8, 15, 17), and (9, 40, 41) — plus any scaled multiple of these, like (6, 8, 10).
- How is this related to the distance formula and a square's diagonal?
- Both are direct applications of this same theorem. The Distance Formula treats the horizontal and vertical coordinate differences between two points as the two legs; a square's diagonal treats two equal sides as the legs — in both cases the Pythagorean theorem solves for the resulting hypotenuse.