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.

Loading calculator…

The Pythagorean theorem

For any right triangle — one containing a 90° angle — the two shorter sides (the legs, aa and bb) and the longest side (the hypotenuse, cc, always opposite the right angle) satisfy:

a2+b2=c2a^2 + b^2 = c^2

Given any two of the three sides, this calculator solves for the third, two ways:

c=a2+b2b=c2a2c = \sqrt{a^2 + b^2} \qquad\qquad b = \sqrt{c^2 - a^2}

The right triangle's area follows directly from the two legs: A=ab2A = \dfrac{ab}{2}.

Tip: The hypotenuse is always the longest side — it's the one facing the right angle. Mixing it up with a leg is the most common setup mistake.

Solving for the hypotenuse

Given both legs, square each one, add the squares, and take the square root:

Example: legs a = 6, b = 8

c=62+82=36+64=100=10c = \sqrt{6^2 + 8^2} = \sqrt{36 + 64} = \sqrt{100} = 10

A=6×82=24A = \frac{6 \times 8}{2} = 24

Since 100 is a perfect square, the hypotenuse comes out exactly whole — no radical needed.

Example: legs a = 1, b = 1

c=12+12=21.4142c = \sqrt{1^2 + 1^2} = \sqrt{2} \approx 1.4142

Here 2 has no perfect-square factor, so 2\sqrt{2} is already in simplest form — the calculator shows both the exact radical and its decimal approximation. Notably, the area is still an exact A=1×12=0.5A = \frac{1 \times 1}{2} = 0.5, 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

b=13252=16925=144=12b = \sqrt{13^2 - 5^2} = \sqrt{169 - 25} = \sqrt{144} = 12

This is the well-known 5-12-13 triple. The area is A=5×122=30A = \frac{5 \times 12}{2} = 30.

Tip: Entering a hypotenuse that isn't longer than the known leg (e.g. c = 5 with a leg of 8) has no solution — the calculator flags it rather than showing a nonsensical negative-under-the-root result.

Pythagorean triples

A Pythagorean triple is a set of three positive integers satisfying a2+b2=c2a^2+b^2=c^2 exactly, so every side — and the hypotenuse — comes out whole. The smallest is:

TripleCheck
(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 cc (or vice versa) gives a nonsensical result.
  • Writing c=a+bc = a + b. 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. a2+b2=c2a^2+b^2=c^2 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 cos90°=0\cos 90° = 0 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 aa and bb and hypotenuse cc (the side opposite the right angle, always the longest), a2+b2=c2a^2 + b^2 = c^2. Given any two of the three sides, the theorem solves for the third.
How do I find the hypotenuse from the two legs?
Solve c=a2+b2c = \sqrt{a^2+b^2}. For legs 6 and 8: c=36+64=100=10c = \sqrt{36+64} = \sqrt{100} = 10 exactly — a classic Pythagorean triple.
How do I find a leg if I know the hypotenuse and the other leg?
Rearrange to b=c2a2b = \sqrt{c^2-a^2}. For a hypotenuse of 13 and a known leg of 5: b=16925=144=12b = \sqrt{169-25} = \sqrt{144} = 12.
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. 136=234\sqrt{136} = 2\sqrt{34} since 136=4×34136 = 4 \times 34) 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.

Related calculators