Pythagorean Theorem Calculator

The Pythagorean theorem, a² + b² = c², gives the third side of a right triangle from the other two. With legs 3 and 4, the hypotenuse is c = √(9 + 16) = √25 = 5 (see the steps). Legs 4 and 6 give c = √52 = 2√13 ≈ 7.2111.

Find the missing side of a right triangle

Type two sides and leave the one you want empty. Fill all three to check for a right angle. The answer updates as you type.

c is the longest side, across from the right angle. Decimals, fractions such as 7/2 and roots such as √2 or sqrt 8 work, and pasting 5, 12, 13 fills all three.

Examples:

How to Use This Calculator

  1. Type two sides

    Legs a and b meet at the right angle. The hypotenuse c is the longest side, across from it.

  2. Leave the unknown empty

    The empty field is the one you get. Fill all three instead to check for a right angle.

  3. Read the answer

    You get the side in simplest radical form and as a decimal, the angles, the area, a drawing and every step.

What is the Pythagorean theorem?

The Pythagorean theorem is a rule about right triangles, the ones with a 90° corner. The two sides that form that corner are the legs, usually called a and b. The side across from it is the hypotenuse, c. It is always the longest of the three.

The theorem says that the square of the hypotenuse equals the squares of the two legs added together: a² + b² = c². You can read this as a fact about areas. Draw a square on each side of the triangle. The two squares on the legs, put together, cover exactly as much area as the square on the hypotenuse. For legs 3 and 4, the small squares have areas 9 and 16, and the big one has area 25. The calculator draws these squares under every answer.

The Pythagorean theorem formula

a² + b² = c²
c = √(a² + b²)   the hypotenuse
a = √(c² − b²)   a leg
b = √(c² − a²)   the other leg

The first line is the theorem. The other three are the same rule solved for each side. To find the hypotenuse you add the squares. To find a leg you subtract. Mixing the two up is an easy slip, so check which side you are looking for before you start.

How to find the hypotenuse

You need both legs. Then there are three steps:

  1. Square each leg.
  2. Add the two squares.
  3. Take the square root of the sum.

With legs 5 and 12: 5² = 25 and 12² = 144. Added, that is 169, and √169 = 13. The hypotenuse is 13. The numbers come out whole here because 5, 12 and 13 form a Pythagorean triple (more on those below).

Show legs 5 and 12

Most pairs of legs do not give a whole number. With legs 4 and 6: 16 + 36 = 52, so c = √52. Since 52 = 4 × 13 and 4 is a perfect square, √52 = 2√13, which is about 7.2111. Homework usually wants 2√13, and a measurement wants the decimal. The calculator gives both.

Show legs 4 and 6

How to find a missing leg

When you know the hypotenuse and one leg, rearrange the formula: a² = c² − b². Square the hypotenuse, subtract the square of the leg you know, and take the square root.

Say the hypotenuse is 10 and one leg is 6. Then 10² − 6² = 100 − 36 = 64, and √64 = 8. The missing leg is 8. A quick check: the leg has to be shorter than the hypotenuse, and 8 is.

Show leg 6 and hypotenuse 10

With a hypotenuse of 9 and a leg of 4, 81 − 16 = 65. Since 65 = 5 × 13 has no square factor, √65 is already in simplest form, about 8.0623. If you ever get a negative number under the root, the leg you typed is longer than the hypotenuse, and no right triangle has those sides.

Show leg 4 and hypotenuse 9

Writing the answer in simplest radical form

A square root is in simplest radical form when the number under the root has no perfect square factor other than 1. To get there, find the largest perfect square (4, 9, 16, 25, 36, …) that divides the number, take its root out front, and leave the rest inside.

  • √52 = √(4 × 13) = 2√13
  • √72 = √(36 × 2) = 6√2
  • √45 = √(9 × 5) = 3√5
  • √50 = √(25 × 2) = 5√2

If you pick a smaller square by mistake, you can simplify again: √72 = √(4 × 18) = 2√18 = 2 × 3√2 = 6√2. You get the same answer, just in more steps. The calculator always takes the largest square factor and shows it in the last step.

Two right triangles come up so often that their sides are worth remembering. In a 45-45-90 triangle both legs are equal, and the hypotenuse is a leg times √2. In a 30-60-90 triangle the short leg is half the hypotenuse and the long leg is the short leg times √3. Type roots such as √2 or 2√3 straight into the calculator, and it shows these angles as exact 30°, 45° and 60°.

Side ratios of the two special right triangles
Triangle Short leg Long leg Hypotenuse Example
45-45-90 x x x√2 1, 1, √2
30-60-90 x x√3 2x 1, √3, 2

How to tell if a triangle is a right triangle

The theorem also works backwards. This is called the converse of the Pythagorean theorem: if the two shorter sides of a triangle satisfy a² + b² = c², the angle across from the longest side is exactly 90°. So you can test any three lengths without measuring an angle.

Square all three sides, add the two smaller squares, and compare the sum with the largest square. If they are equal, the triangle is right. If the sum is bigger, the largest angle is less than 90° and the triangle is acute. If the sum is smaller, the largest angle is more than 90° and the triangle is obtuse. Fill in all three fields of the calculator and it runs this test for you.

Checking three sets of sides with the converse
Sides a² + b² c² Triangle
8, 15, 17 64 + 225 = 289 289 Right
5, 6, 7 25 + 36 = 61 49 Acute
5, 6, 8 25 + 36 = 61 64 Obtuse

Before any of this, the lengths have to make a triangle at all. The two shorter sides together must be longer than the third. Sides 1, 2 and 3 fail: 1 + 2 is not more than 3, so they lie flat. With measured sides, a tiny miss usually means rounding, not a wrong angle. 1, 1 and 1.41 is off by less than 1%, because √2 is 1.41421…

Pythagorean triples

A Pythagorean triple is a set of three whole numbers that fit a² + b² = c². The smallest is 3, 4, 5. A triple is primitive when the three numbers share no common factor. Here is every primitive triple with a hypotenuse up to 65.

Primitive Pythagorean triples with a hypotenuse up to 65
a b c Check m, n
3 4 5 9 + 16 = 25 2, 1
5 12 13 25 + 144 = 169 3, 2
8 15 17 64 + 225 = 289 4, 1
7 24 25 49 + 576 = 625 4, 3
20 21 29 400 + 441 = 841 5, 2
12 35 37 144 + 1,225 = 1,369 6, 1
9 40 41 81 + 1,600 = 1,681 5, 4
28 45 53 784 + 2,025 = 2,809 7, 2
11 60 61 121 + 3,600 = 3,721 6, 5
16 63 65 256 + 3,969 = 4,225 8, 1
33 56 65 1,089 + 3,136 = 4,225 7, 4

Multiply a triple by any whole number and you get another one: 3-4-5 gives 6-8-10, 9-12-15 and 30-40-50. The calculator spots these and tells you which primitive triple a set of sides is a multiple of.

To make your own, use Euclid's formula. Pick two whole numbers m and n with m bigger than n. Then a = m² − n², b = 2mn and c = m² + n² is always a triple. With m = 2 and n = 1 you get 3, 4, 5. With m = 3 and n = 2 you get 5, 12, 13. The last column of the table shows the m and n behind each row. If m and n share no factor and one of them is even, the triple is primitive.

Pythagorean theorem word problems

In a word problem, the hard part is spotting the right triangle and deciding which length is the hypotenuse. Look for a corner that is square: a wall and the floor, the sides of a screen, north and east on a map. The hypotenuse is the slanted line across from that corner.

A ladder against a wall

A 13 ft ladder leans against a wall with its foot 5 ft from the wall. How high up the wall does it reach? The wall and the ground meet at a right angle, and the ladder is the hypotenuse. So the height is √(13² − 5²) = √(169 − 25) = √144 = 12 ft.

Show the ladder

The width of a TV screen

A 55-inch TV is 55 inches across the diagonal, and the screen has a 16:9 shape. The diagonal of a 16 by 9 rectangle is √(256 + 81) = √337. Scale that up to 55 inches and the screen is about 47.9 inches wide and 27 inches tall: each side is 55 ÷ √337 times 16 or 9.

Show the 16 by 9 diagonal

Squaring a corner with 3-4-5

Builders use the theorem to check that a corner is square without a large set square. Mark 6 ft along one wall and 8 ft along the other. If the corner is a true right angle, the distance between the two marks is exactly 10 ft, because 36 + 64 = 100. If it is more than 10 ft, the corner is wider than 90°. If it is less, the corner is too tight. This is the 3-4-5 triple made twice as big.

Check 6, 8, 10

The distance between two points

On a grid, the distance between (1, 2) and (7, 10) is the hypotenuse of a right triangle. The horizontal leg is 7 − 1 = 6 and the vertical leg is 10 − 2 = 8, so the distance is √(36 + 64) = 10. This is where the distance formula, d = √((x₂ − x₁)² + (y₂ − y₁)²), comes from.

Show legs 6 and 8

The diagonal of a box

A box measures 3 by 4 by 12. How long is the longest stick that fits inside, from one bottom corner to the opposite top corner? Use the theorem twice. The diagonal of the floor is √(3² + 4²) = 5. That floor diagonal and the height of 12 form a second right triangle, so the full diagonal is √(5² + 12²) = 13. In one step, it is √(a² + b² + h²).

Show the second triangle

Cutting across a park

A park is a rectangle 300 m by 400 m. Walking along two edges from one corner to the opposite one is 700 m. The path straight across is √(300² + 400²) = √250,000 = 500 m, which saves 200 m.

Show the park

Common mistakes

  • Adding the legs before squaring them. (3 + 4)² is 49, but 3² + 4² is 25. Square each leg first, then add.
  • Adding when you need a leg. The hypotenuse is always the longest side, so if your leg comes out longer than the hypotenuse, you should have subtracted.
  • Stopping at c². If c² = 25, the side is c = 5, so take the square root at the end.
  • Rounding halfway through. Keep √52 or 2√13 until the last step, because rounded squares can change the final digit.
  • Using the theorem on a triangle with no right angle. Other triangles need the law of cosines.

Frequently Asked Questions

What is the Pythagorean theorem formula?

a² + b² = c², where a and b are the two legs of a right triangle and c is the hypotenuse, the longest side across from the right angle. To find c, use c = √(a² + b²). To find a leg, use a = √(c² − b²).

How do you find the hypotenuse?

Square both legs, add the squares, and take the square root. For legs 5 and 12, 25 + 144 = 169 and √169 = 13, so the hypotenuse is 13.

Show legs 5 and 12

How do you find a missing leg of a right triangle?

Square the hypotenuse, subtract the square of the leg you know, and take the square root. For a hypotenuse of 10 and a leg of 6, 100 − 36 = 64 and √64 = 8.

Show leg 6 and hypotenuse 10

How do you know if a triangle is a right triangle?

Square all three sides and check whether the two smaller squares add up to the largest one. 8, 15 and 17 is a right triangle because 64 + 225 = 289 = 17². If the sum is bigger, the triangle is acute; if it is smaller, it is obtuse.

Check 8, 15, 17

Does the Pythagorean theorem work for all triangles?

No, only for right triangles. For any other triangle, use the law of cosines, c² = a² + b² − 2ab·cos C. When C is 90°, cos C is 0 and it turns back into the Pythagorean theorem.

What are the most common Pythagorean triples?

3-4-5, 5-12-13, 8-15-17 and 7-24-25 are the ones you see most in textbooks. Any multiple of a triple is also a triple, so 6-8-10 and 9-12-15 work too.