How to Find the Missing Side of a Right Triangle

When you know the hypotenuse and one leg, subtract instead of add. This page shows why, walks through five examples and gives you a shortcut that makes many of these problems mental math.

By the PythagoreanTheorem.net teamUpdated 8 min read

To find a missing leg of a right triangle, square the hypotenuse, subtract the square of the leg you know, and take the square root: a = √c2 − b2. For a hypotenuse of 13 and a leg of 5, the missing leg is √169 − 25 = √144 = 12.

If the missing side is the hypotenuse instead (you know both legs), you add the squares: see how to find the hypotenuse. Everything on this page is about the other case, finding a leg.

The formula for a missing leg

Start from the Pythagorean theorem formula, a2 + b2 = c2, where a and b are the legs and c is the hypotenuse. To get a on its own, subtract b2 from both sides, then take the square root:

a2 + b2= c2a2= c2 − b2a= √c2 − b2

The same steps give the formula for the other leg, b = √c2 − a2. The letters don't matter; the pattern does. Hypotenuse squared, minus the known leg squared.

You knowYou wantFormula
both legs, a and bhypotenuse cc = √a2 + b2 (add)
hypotenuse c and leg bleg aa = √c2 − b2 (subtract)
hypotenuse c and leg aleg bb = √c2 − a2 (subtract)

Why you subtract

Think of the theorem as a statement about areas. The square on the hypotenuse has exactly the same area as the two leg squares put together. If you take away one leg square, what remains must be the other leg square.

b² = 16 c² = 25 tiles a² = 9 tiles 25 − 16 = 9, so a = √9 = 3
For the 3-4-5 triangle: remove the 16 tiles of b2 from the 25 tiles of c2. The 9 tiles left over rearrange into a 3 × 3 square, so the missing leg is 3.

This also explains why the hypotenuse squared always comes first. It is the biggest square, so it is the one you subtract from.

Step by step: how to find a leg

  1. Find the hypotenuse. It is the side opposite the right angle and the longest side. Label it c. If you are unsure which side is which, see parts of a right triangle.
  2. Write the theorem and substitute. Put the hypotenuse in the c spot and the known leg in the b spot: a2 + b2 = c2.
  3. Square the two known numbers.
  4. Subtract. Hypotenuse squared minus leg squared. The result is a2.
  5. Take the square root to get a. Keep only the positive root, since lengths are positive.
  6. Check. Your leg must be shorter than the hypotenuse, and a2 + b2 should equal c2.

Worked examples

Example 1: find a when b and c are given

A right triangle has hypotenuse c = 26 and leg b = 10. Find leg a.

a= √c2 − b2= √262 − 102= √676 − 100= √576 = 24

a = 24. Check: 242 + 102 = 576 + 100 = 676 = 262. (10-24-26 is the 5-12-13 Pythagorean triple doubled.)

Example 2: find b when a and c are given

The hypotenuse is 9 and leg a is 4. Find b to the nearest hundredth.

b= √92 − 42= √81 − 16= √65 ≈ 8.06

b = √65 ≈ 8.06. Since 65 = 5 × 13 has no perfect-square factor, √65 is already in simplest form.

Example 3: a radical that simplifies

The hypotenuse is 12 and one leg is 6. Find the other leg exactly.

a= √122 − 62= √144 − 36 = √108= √36 · 3 = 6√3 ≈ 10.39

a = 6√3. The hypotenuse is twice the short leg, so this is a 30-60-90 triangle, whose long leg is always the short leg times √3.

Example 4: decimals

The hypotenuse is 7.5 cm and one leg is 4.5 cm. Find the other leg.

a= √7.52 − 4.52= √56.25 − 20.25= √36 = 6

The missing leg is 6 cm. (Divide every side by 1.5 and you get 3-4-5.)

Example 5: how high does the ladder reach?

A 15-foot ladder leans against a wall. Its foot is 4 feet from the base of the wall. How high up the wall does it reach?

h = ?4 ft15 ft
The ladder is the hypotenuse, so the height is a leg.
h= √152 − 42= √225 − 16= √209 ≈ 14.46

The ladder reaches about 14.46 feet (to the nearest hundredth) up the wall. The ladder calculator also gives the angle, which matters for safety.

More practice: the missing side worksheet has printable problems with answers, the word problems page has real-world setups, and the missing side calculator checks any answer with full working.

The difference-of-squares shortcut

The expression c2 − b2 is a difference of two squares, and it always factors:

c2 − b2 = (c − b)(c + b)

So instead of squaring two large numbers, you can subtract them, add them and multiply. The picture shows why it works: the L-shaped leftover is two strips of width c − b, and laid end to end they form one rectangle of length c + b.

b²12 cbc − b 12 c + b c − b c² − b² = (c − b)(c + b)
Cut the L-shaped region c2 − b2 into strips 1 and 2 and line them up: the area is (c − b)(c + b).

The shortcut is fastest when the hypotenuse and the known leg are close together, because then c − b is tiny:

cbc − bc + bproductmissing leg
2524149497
4140181819
1715232648
6563212825616
10199220040020
292185040020

Try c = 101, b = 99 the long way: 10201 − 9801 = 400. Same answer, much more arithmetic. The trick also works with decimals (Example 4: (7.5 − 4.5)(7.5 + 4.5) = 3 × 12 = 36) and sometimes hands you the square root directly. In Example 1, (26 − 10)(26 + 10) = 16 × 36, and since both factors are perfect squares, a = 4 × 6 = 24 without ever computing 576.

TipThe shortcut is still the Pythagorean theorem, only factored. Use it for mental math or to check calculator work; on a test, writing √(c − b)(c + b) is just as valid as √c2 − b2.

Impossible inputs: when there is no triangle

A leg is always shorter than the hypotenuse. If a problem (or your own setup) gives a "leg" that is as long as or longer than the "hypotenuse", the subtraction tells you something is wrong:

  • Leg longer than hypotenuse. c = 5, b = 7: c2 − b2 = 25 − 49 = −24. No real number squared gives a negative, so no such triangle exists.
  • Leg equal to hypotenuse. c = 6, b = 6: c2 − b2 = 0, so a = 0. The "triangle" has collapsed into a flat line.
a = 3c = 5b = 4A gapc = 5b = 7A possible: a = √(25 − 16) = 3impossible: 25 − 49 = −24
Swing a hypotenuse of length 5 up from corner A. With b = 4 it meets the vertical leg at height 3. With b = 7 it can never reach, which is what the negative number is telling you.

In homework, a negative under the square root almost always means the hypotenuse was put in the wrong place. Re-read the problem: the longest side, opposite the right angle, is c. If the problem gives you two legs, you should be adding, not subtracting. A calculator that shows "Error" or "NaN" for √−24 is saying the same thing.

Sign errors and other slips

WrongHypotenuse 13, leg 5: a = √52 − 132 = √−144, "no answer".

RightSubtract the smaller square from the larger: a = √169 − 25 = √144 = 12.

  • Adding instead of subtracting. √169 + 25 ≈ 13.93 is longer than the hypotenuse, which is impossible for a leg.
  • Subtracting the sides, not the squares. 13 − 5 = 8 is not the leg, and neither is √8. You must square first.
  • Splitting the square root. √c2 − b2 is not c − b. For 13 and 5, √169 − 25 = 12, while 13 − 5 = 8.
  • Forgetting the root. Stopping at 144 gives the area of the leg's square, not its length.

A quick range check catches all of these. Because any two sides of a triangle add up to more than the third, the missing leg must lie between c − b and c. For hypotenuse 13 and leg 5, the answer has to be between 8 and 13; 12 passes, while 13.93, 8 and 144 all fail. The common mistakes page has more examples of each slip.

Radical and decimal answers

When c2 − b2 is a perfect square (144, 576, 36…), the leg is a whole number or a tidy decimal. Otherwise you have two choices, and many problems want both:

  • Exact answer in simplest radical form. Pull out the largest perfect-square factor: hypotenuse 10 and leg 2 give √100 − 4 = √96 = √16 · 6 = 4√6. See square roots and simplifying radicals for the method, or use the simplify square root calculator.
  • Rounded decimal. 4√6 ≈ 9.80 to the nearest hundredth. Round once, at the end, to the precision the problem asks for.

Sometimes the hypotenuse itself is a radical. Squaring a square root just removes it, so the subtraction is easy: if c = √50 and b = 5, then a = √50 − 25 = √25 = 5. That triangle has two equal legs, the 45-45-90 triangle.

Frequently asked questions

How do you find the missing side of a right triangle?

First decide which side is missing. If it is the hypotenuse, use c = √a2 + b2. If it is a leg, use a = √c2 − b2: hypotenuse squared minus the other leg squared, then the square root. If you know one side and an angle instead of two sides, use sine, cosine or tangent (see Pythagoras or trig?).

What is the formula to find a in the Pythagorean theorem?

a = √c2 − b2. It comes from rearranging a2 + b2 = c2: subtract b2 from both sides, then take the square root. The formula for b is the same with the letters swapped, b = √c2 − a2.

Why do you subtract when finding a leg?

The square on the hypotenuse equals the two leg squares combined. Removing one leg square from the hypotenuse square leaves exactly the other leg square, so subtraction undoes the addition in the theorem.

What does it mean if I get a negative number under the square root?

It means the numbers can't form a right triangle with that side as the hypotenuse. Usually a leg has been put in the hypotenuse's place, or the subtraction was done the wrong way round. Check that the longest side is c and that you computed c2 − b2, not b2 − c2.

Can I use this for a triangle without a right angle?

No. The formula only works when one angle is exactly 90°. For other triangles use the law of cosines, which reduces to the Pythagorean theorem when the angle is 90°. To check whether three lengths make a right triangle, use the converse of the theorem.

Keep exploring