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 − b2The 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 know | You want | Formula |
|---|---|---|
| both legs, a and b | hypotenuse c | c = √a2 + b2 (add) |
| hypotenuse c and leg b | leg a | a = √c2 − b2 (subtract) |
| hypotenuse c and leg a | leg b | b = √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.
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
- 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.
- Write the theorem and substitute. Put the hypotenuse in the c spot and the known leg in the b spot: a2 + b2 = c2.
- Square the two known numbers.
- Subtract. Hypotenuse squared minus leg squared. The result is a2.
- Take the square root to get a. Keep only the positive root, since lengths are positive.
- 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 = 24a = 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.06b = √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.39a = 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 = 6The 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?
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.
The shortcut is fastest when the hypotenuse and the known leg are close together, because then c − b is tiny:
| c | b | c − b | c + b | product | missing leg |
|---|---|---|---|---|---|
| 25 | 24 | 1 | 49 | 49 | 7 |
| 41 | 40 | 1 | 81 | 81 | 9 |
| 17 | 15 | 2 | 32 | 64 | 8 |
| 65 | 63 | 2 | 128 | 256 | 16 |
| 101 | 99 | 2 | 200 | 400 | 20 |
| 29 | 21 | 8 | 50 | 400 | 20 |
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.
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
- CalculatorsMissing Side Calculator (Find a Leg)Find the missing side of a right triangle from the hypotenuse and one leg. Enter b and c to get a, or a and c to get b, with steps, exact radicals and a check.
- LearnThe Hypotenuse: What It Is and How to Find ItWhat the hypotenuse of a right triangle is, why it is always the longest side, and how to find it with c = √(a² + b²): five worked examples plus a trig method.
- PracticeFind the Missing Side WorksheetPrintable find the missing side worksheet: 16 Pythagorean theorem problems to find a missing leg or the hypotenuse, with a step-by-step answer key.
- LearnSquare Roots and Radicals for the Pythagorean TheoremThe square-root toolkit for the Pythagorean theorem: perfect squares 1–30, estimating roots, simplest radical form step by step, exact vs decimal answers.
- LearnCommon Pythagorean Theorem MistakesTwelve common Pythagorean theorem mistakes, from a + b = c to misusing the converse, each with a wrong-vs-right worked example and a final self-check list.
- PracticePythagorean Theorem Word Problems15 Pythagorean theorem word problems from real life (ladders, TVs, ramps, ships, kites, roofs) with a 4-step strategy, a sketch for each and full solutions.