Pythagorean theorem calculator: find the hypotenuse or a missing side
The Pythagorean theorem says that in a right triangle, a² + b² = c², where a and b are the two shorter sides (the legs) and c is the hypotenuse, the longest side, opposite the right angle. So the hypotenuse is c = √(a² + b²), and a missing leg is a = √(c² − b²). Legs of 5 and 12 give a hypotenuse of 13. This Pythagorean theorem calculator is part of our Trigonometry Calculator: type two sides, mark the right angle and press Solve, and it gives the third side and both other angles. The method is below so you can check it by hand.
Trigonometry Calculator
Interactive triangle solver with step-by-step
How to use the Trigonometry Calculator for Pythagoras
The Trigonometry Calculator solves whole triangles, and the Pythagorean theorem is one part of it. There are two ways to use it for a missing side.
Solve the triangle: any missing side
- Open the calculator. It starts on the unit circle, so at the top of the sidebar choose Standard triangle.
- Under Triangle, find the panel that says "Type any three values, including a side, then Solve". It has boxes for the sides a, b and c and the angles A, B and C. Each side is opposite the angle with the same letter.
- Press Right angle at C. It fills in C = 90°, which makes c the hypotenuse.
- For the hypotenuse, type the two legs in a and b. For a missing leg, type the leg you know in a and the hypotenuse in c.
- Press Solve. The triangle is redrawn to fit the view, Measurements shows every side and angle, and a line under the buttons names the method it used.
With a = 5, b = 12 and the right angle at C, it gives c = 13, and the other angles A = 22.62° and B = 67.38°. With a = 8 and c = 17 it gives b = 15. Measurements rounds sides to 2 decimal places, and Formulas adds a Pythagorean Theorem card, a² + b² = c², for the solved triangle. If the hypotenuse you type is shorter than the leg, it tells you no triangle fits. Clear empties the boxes for the next one.
The calculator gives the answer and names the rule it used, but it doesn't write out the working for a solve. The worked examples below show that.
Quick sum: type it in Evaluate
- Open the calculator and find the Evaluate section in the sidebar.
- For a hypotenuse, type sqrt(5^2+12^2) with your two legs in place of 5 and 12. The answer, 13, appears under the box.
- For a missing leg, subtract instead: sqrt(17^2-8^2) gives 15 for a hypotenuse of 17 and a leg of 8.
This works for any lengths, including decimals, and gives the answer to up to six decimal places.
The Pythagorean theorem formula
The square on the hypotenuse has the same area as the squares on the other two sides added together. It only works for right triangles, and it was proved in Euclid's Elements (Book I, Proposition 47), though the rule was known long before. Rearranged, it gives the two forms you use:
| To find | Formula | In words |
|---|---|---|
| The hypotenuse c | c = √(a² + b²) | Square both legs, add, square root |
| A leg a | a = √(c² − b²) | Square the hypotenuse and the known leg, subtract, square root |
Which side is the hypotenuse?
The hypotenuse is always opposite the right angle, and it is always the longest side. Find it first, before any numbers go in: getting it wrong is the most common Pythagoras mistake. Try labelling a triangle's sides, then press Mark to check in the course.
Label the sides of a right-angled triangle.
Press Mark to have your answer marked in the Trigonometry course.
Worked examples you can check in the calculator
Example 1: find the hypotenuse
A right triangle has legs of 5 cm and 12 cm. How long is the hypotenuse?
The hypotenuse is 13 cm. In the calculator, type a = 5 and b = 12, press Right angle at C and Solve: c comes out as 13. In Evaluate, sqrt(5^2+12^2) gives 13 too.
Example 2: find a missing leg
A right triangle has a hypotenuse of 17 m and one leg of 8 m. Find the other leg.
The missing leg is 15 m. You subtract because the hypotenuse is the biggest square: the leg's square is what is left over. To check, type a = 8 and c = 17 with the right angle at C, and Solve gives b = 15.
Example 3: an answer that isn't a whole number
The legs are 7 and 9. Then c² = 49 + 81 = 130, so c = √130 = 11.40 to 2 decimal places. Most answers look like this. Leave it as √130 if the question asks for an exact answer (a surd, or radical in the US), and round only at the end.
Example 4: a ladder against a wall
A 6 m ladder leans against a wall with its foot 1.5 m from the wall. How high up the wall does it reach?
The wall and the ground make the right angle, so the ladder is the hypotenuse. The height is a leg:
It reaches 5.81 m up the wall. Drawing a quick sketch and marking the right angle first makes it obvious which side is the hypotenuse.
Example 5: the diagonal of a TV screen
Screens are sold by their diagonal. A screen is 48 inches wide and 27 inches tall. Is it a 55 inch screen?
The diagonal is 55.07 inches, so yes. The width, height and diagonal form a right triangle, as does any rectangle cut corner to corner.
Try one
Is it a right triangle? The converse of the Pythagorean theorem
The theorem works backwards too. If the two shorter sides squared add up to the longest side squared, the triangle has a right angle. If not, it doesn't.
- 20, 21 and 29: 20² + 21² = 400 + 441 = 841 and 29² = 841. They match, so it is a right triangle.
- 8, 11 and 14: 8² + 11² = 64 + 121 = 185 but 14² = 196. They don't match, so there is no right angle. The longest side squared is bigger, so the biggest angle is obtuse (more than 90°).
To check in the calculator, choose Standard triangle, type all three sides in a, b and c with no angles, and press Solve. For 20, 21 and 29, angle C comes out as 90° and the badge in the Triangle section reads right. For 8, 11 and 14, C is 93.58°, just over a right angle. Or compare the two totals in Evaluate: 20^2+21^2 and 29^2 both give 841.
Pythagorean triples
A Pythagorean triple is three whole numbers that fit a² + b² = c². Spotting one saves the working. Any multiple of a triple is also a triple, so 6, 8, 10 comes from 3, 4, 5.
| Triple | Check | Multiples |
|---|---|---|
| 3, 4, 5 | 9 + 16 = 25 | 6, 8, 10 and 9, 12, 15 |
| 5, 12, 13 | 25 + 144 = 169 | 10, 24, 26 |
| 8, 15, 17 | 64 + 225 = 289 | 16, 30, 34 |
| 7, 24, 25 | 49 + 576 = 625 | 14, 48, 50 |
| 20, 21, 29 | 400 + 441 = 841 | 40, 42, 58 |
Distance between two points and 3D Pythagoras
The distance formula is the Pythagorean theorem on a grid. The horizontal and vertical gaps between two points are the legs, and the straight line between them is the hypotenuse. From (1, 2) to (7, 10) the gaps are 6 and 8, so the distance is √(36 + 64) = 10. The midpoint and distance calculator draws this for any two points.
In 3D you use it twice, which comes to adding three squares. The longest straight line inside a box 3 by 4 by 12 is:
Common mistakes
- Adding when you should subtract. Add the squares to find the hypotenuse. Subtract from the hypotenuse's square to find a leg. If your leg comes out longer than the hypotenuse, you added.
- Forgetting the square root. a² + b² gives c², not c. In example 1, 169 is c² and 13 is c.
- Adding the sides before squaring. (5 + 12)² = 289 is not 5² + 12² = 169.
- Using it on a triangle without a right angle. For other triangles use the cosine rule (the law of cosines), which the same calculator also does.
- Rounding too early. Keep the full value of c² and round once, at the end.
- Mixed units. Change everything to the same unit before squaring.
Common questions
How do you find the hypotenuse?
How do you find a missing side of a right triangle?
Does the Pythagorean theorem work for all triangles?
Is the Pythagorean theorem the same as Pythagoras' theorem?
Can the answer be a decimal?
How do I find the angles once I know the sides?
Revision cards
Read the front, say your answer, then flip to check.
Where to go next
- Solve it
Trigonometry Calculator
Interactive triangle solver with step-by-step
Open the tool - Learn it
Trigonometry
Understand the true math behind everyday geometry with trig functions and identities
Start the course - Test it
Geometry, Algebra 2 & SAT Math
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper