How to Do the Pythagorean Theorem, Step by Step

A method that works on every right-triangle problem, a flowchart for the one decision that matters (add or subtract?), worked examples for each case and a checklist to catch mistakes.

By the PythagoreanTheorem.net teamUpdated 8 min read

To do the Pythagorean theorem, find the right angle, label the side opposite it c (the hypotenuse) and the other two sides a and b, then substitute the two lengths you know into a2 + b2 = c2. Square them, add to find c or subtract to find a leg, and take the square root.

Below, that sentence is broken into eight steps you can follow on any problem, followed by a worked example of each type. If you first want to understand what the theorem says, read what the Pythagorean theorem is; for the algebra behind each version of the equation, see the Pythagorean theorem formula.

How to use the Pythagorean theorem in 8 steps

  1. Check for a right angle. Look for the small square in a corner, the words "right triangle", or an angle given as 90°. No right angle, no Pythagorean theorem.
  2. Find the hypotenuse. It is the side directly across from the right angle, the one that does not touch it. Whatever the triangle's position on the page, this is your c. (More on the parts of a right triangle.)
  3. Label the legs. The two sides that form the right angle are a and b. Which one is a does not matter.
  4. Decide which side is missing. If it is c, you will add. If it is a or b, you will subtract.
  5. Write the formula and substitute. Copy a2 + b2 = c2 and replace the letters you know with numbers. Writing the formula first stops you from putting a number in the wrong place.
  6. Square the numbers. Multiply each known side by itself: 72 = 49, not 14.
  7. Add or subtract, then take the square root. For the hypotenuse, add the two squares. For a leg, subtract the smaller square from the larger. Then take the square root of the result to get back to a length.
  8. Check the answer. The hypotenuse must be the longest side and shorter than the two legs added together. Give the exact answer, a rounded decimal if asked, and the units.

Steps 1 to 3 are where most mistakes happen, especially when the triangle is drawn in an unusual position. The animation shows them on a triangle whose hypotenuse lies along the bottom.

1Find the right angle2across from it: hypotenuse cab3the other twosides: legs a, ba² + b² = c²
Find the right angle first. The side across from it is the hypotenuse, even when it is not the slanted side you expect. The other two sides are the legs.

Flowchart: add or subtract?

Once the sides are labeled, the whole problem comes down to one decision. Follow the arrows:

Does the triangle have a right angle?Not a right triangle:use the law of cosinesNoYesWhich side is missing?The hypotenuse c(opposite the right angle)ADD the squaresc = √(a² + b²)A leg, a or b(touches the right angle)SUBTRACT the squaresa = √(c² − b²)ca or bCheck: c is the longest sideand c is less than a + b
Missing hypotenuse: add the squares. Missing leg: subtract them. Either way, finish with a square root and a check.

A memory aid: the hypotenuse is the biggest side, and adding makes numbers bigger. A leg is smaller than the hypotenuse, and subtracting makes numbers smaller. If you ever find yourself subtracting to get a hypotenuse or adding to get a leg, stop and relabel. Triangles without a right angle need a different tool, the law of cosines.

Case 1: finding the hypotenuse

You know both legs and want the longest side. The formula is c = √a2 + b2. The answer may be a whole number or a square root that does not simplify to one; both are handled the same way. The hypotenuse page has more examples of this case.

Example 1: a whole-number answer

A right triangle has legs 12 and 35. Find the hypotenuse.

c2= 122 + 352= 144 + 1225= 1369c= √1369 = 37

c = 37. Check: 37 is more than 35 and less than 12 + 35 = 47.

Example 2: an answer in radical form

A right triangle has legs 6 cm and 9 cm. Find the hypotenuse exactly and to the nearest hundredth.

c2= 62 + 92 = 36 + 81 = 117c= √117 = √9 · 13 = 3√13c≈ 10.82

c = 3√13 cm exactly, or about 10.82 cm. 117 is not a perfect square, so look for a square factor (here 9) to simplify. The method is on the square roots and radicals page.

Case 2: finding a missing leg

You know the hypotenuse and one leg. Rearranged, the formula is a = √c2 − b2: square both, subtract the leg's square from the hypotenuse's square, then take the root. More practice is on how to find a missing side.

Example 3: a whole-number answer

The hypotenuse is 25 and one leg is 24. Find the other leg.

a2= 252 − 242= 625 − 576= 49a= √49 = 7

The other leg is 7. Notice how much shorter it is: when one leg is almost as long as the hypotenuse, the other must be short.

Example 4: an answer that does not simplify

The hypotenuse is 10 m and one leg is 7 m. Find the other leg.

b2= 102 − 72 = 100 − 49 = 51b= √51 ≈ 7.14

b = √51 m, about 7.14 m. Because 51 = 3 × 17 has no square factor, √51 is already in simplest form.

Case 3: turned and hidden right triangles

Real problems rarely show a right triangle in the textbook position. Two situations come up again and again: a triangle drawn at an angle, and a right triangle hiding inside another shape.

21?29Turned: the hypotenuse is at the bottom101066hHidden: the height splits it in two
Left: the side across from the right angle is the hypotenuse, here along the bottom. Right: the height of an isosceles triangle cuts it into two identical right triangles.

Example 5: a turned triangle

In the left diagram the right angle is at the top. The side opposite it, 29, is the hypotenuse; 21 is a leg, and the unknown is the other leg.

x2= 292 − 212 = 841 − 441 = 400x= √400 = 20

The missing leg is 20. If you had treated 29 as a leg and added, you would have got √841 + 441 ≈ 35.81 for the unknown side, longer than the side opposite the right angle, which is impossible.

Example 6: a hidden right triangle

An isosceles triangle has two sides of 10 and a base of 12. Find its height.

The height meets the base at a right angle and cuts it in half, creating a right triangle with hypotenuse 10 and one leg 6.

h2= 102 − 62 = 100 − 36 = 64h= √64 = 8

The height is 8. The same idea works for any isosceles or equilateral triangle; see finding the height of a triangle.

Other common hiding places are the diagonal of a rectangle, the distance between two points on a grid and the slant edge of a roof. The word problems page shows how to sketch each one and find the right angle.

Check that your answer is reasonable

You do not need a calculator to catch most wrong answers. Before you finish, test the result against two facts that are true for every right triangle:

  • The hypotenuse is longer than either leg.
  • The hypotenuse is shorter than the two legs added together, because a straight line is the shortest path between two corners.
06915c belongs herelonger lega + bshorter leg10.82 ✓6.71 ✗
With legs 6 and 9, the hypotenuse must fall between 9 and 15. The correct 10.82 passes; 6.71, the result of subtracting by mistake, does not.

You can also estimate before calculating. In Example 2, c2 = 117 sits between 102 = 100 and 112 = 121, so c must be between 10 and 11, a bit closer to 11. When you are finding a leg, the check runs the other way: the leg must be shorter than the hypotenuse. For a deeper list of slips, see common Pythagorean theorem mistakes.

Calculator tips

The arithmetic is short, but calculators can trip you up in a few predictable ways:

  • Make the square root cover the whole sum. Type √(6² + 9²), closing the bracket after the last square. If you get 87, the calculator took the root of 62 alone: √62 + 92 = 6 + 81 = 87, not 10.82.
  • Use the x2 key, or multiply the number by itself. Typing 6 × 2 gives 12, not 36.
  • On a basic or phone calculator, work in pieces. Some basic calculators work strictly left to right, so 6 × 6 + 9 × 9 can come out as 405. Find each square separately, write them down, add or subtract, then press √.
  • In a spreadsheet or graphing app, type =SQRT(6^2+9^2) or sqrt(6^2+9^2).
  • Round only at the end. If a problem has several steps, keep the full value (or the exact radical) until the final answer, then round to the precision asked for.

To check a result instantly, the Pythagorean theorem calculator shows each step, the exact radical and the decimal.

Printable checklist

Pythagorean theorem checklist

  1. Is there a right angle? Mark it.
  2. Mark the hypotenuse c: the side across from the right angle.
  3. Label the legs a and b, and the unknown side.
  4. Missing c? Add. Missing a leg? Subtract.
  5. Write a2 + b2 = c2, then substitute.
  6. Square each known side (multiply it by itself, do not double it).
  7. Add or subtract, then take the square root.
  8. Simplify the radical if there is one; round only if asked.
  9. Check: c is longest, and c is less than a + b.
  10. Write the units.

Copy it into your notes, or print this page. When the steps feel automatic, try the practice problems, which mix all three cases.

Frequently asked questions

What are the steps for solving the Pythagorean theorem?

Find the right angle and label the hypotenuse c and the legs a and b. Substitute the two known lengths into a2 + b2 = c2, square them, add (for c) or subtract (for a leg), take the square root, and check that the hypotenuse is the longest side.

How do I know whether to add or subtract?

Look at which side is unknown. If it is the hypotenuse, the side across from the right angle, add the squares. If it is one of the two sides touching the right angle, subtract the known leg's square from the hypotenuse's square.

Can I use the Pythagorean theorem if I only know one side?

Not on its own; you need two sides. With one side and an acute angle, use trigonometry instead (see Pythagoras or trig?). If the triangle is a special one, such as a 45-45-90 or 30-60-90 triangle, its fixed side ratios give the other sides from just one.

What do I do if the answer is not a whole number?

Leave it as a square root, simplified if possible (for example √117 = 3√13), or round the decimal to the place your teacher asks for. Most right triangles do not have whole-number sides, so this is normal, not a sign of a mistake.

How can I check my answer quickly?

The hypotenuse must be longer than each leg and shorter than their sum. For an exact check, square all three sides and confirm that the two smaller squares add up to the largest.

Keep exploring