Uni-Sine
MathematicsGeometry

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.

Try it

Trigonometry Calculator

Interactive triangle solver with step-by-step

Go to its page

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

  1. Open the calculator. It starts on the unit circle, so at the top of the sidebar choose Standard triangle.
  2. 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.
  3. Press Right angle at C. It fills in C = 90°, which makes c the hypotenuse.
  4. 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.
  5. 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

  1. Open the calculator and find the Evaluate section in the sidebar.
  2. 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.
  3. 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

a^2 + b^2 = c^2a and b are the legs, c is the hypotenuse
a = 4c = 5b = 3ABChypotenuse
3² + 4² = 9 + 16 = 25 = 5²

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 findFormulaIn words
The hypotenuse cc = √(a² + b²)Square both legs, add, square root
A leg aa = √(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?

c^2 = 5^2 + 12^2 = 25 + 144 = 169
c = \sqrt{169} = 13

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.

a^2 = 17^2 - 8^2 = 289 - 64 = 225
a = \sqrt{225} = 15

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:

h = \sqrt{6^2 - 1.5^2} = \sqrt{36 - 2.25} = \sqrt{33.75} = 5.81

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?

d = \sqrt{48^2 + 27^2} = \sqrt{2304 + 729} = \sqrt{3033} = 55.07

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

practice
Pick an answer, then check it.
A right triangle has legs of 9 and 12. How long is the hypotenuse?

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.

TripleCheckMultiples
3, 4, 59 + 16 = 256, 8, 10 and 9, 12, 15
5, 12, 1325 + 144 = 16910, 24, 26
8, 15, 1764 + 225 = 28916, 30, 34
7, 24, 2549 + 576 = 62514, 48, 50
20, 21, 29400 + 441 = 84140, 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:

d = \sqrt{3^2 + 4^2 + 12^2} = \sqrt{9 + 16 + 144} = \sqrt{169} = 13

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?
Square the two legs, add them, and take the square root: c = √(a² + b²). For legs of 5 and 12, c = √169 = 13.
How do you find a missing side of a right triangle?
If the missing side is a leg, square the hypotenuse, subtract the square of the other leg, and take the square root: a = √(c² − b²). For a hypotenuse of 17 and a leg of 8, a = √225 = 15. If you know one side and an angle instead, use SOH CAH TOA. The calculator's solver handles both: type what you know, press Right angle at C, then Solve.
Does the Pythagorean theorem work for all triangles?
No, only right triangles. For any other triangle, use the cosine rule, c² = a² + b² − 2ab cos C. When C = 90°, cos C = 0 and it becomes the Pythagorean theorem.
Is the Pythagorean theorem the same as Pythagoras' theorem?
Yes. Pythagorean theorem is the usual US name and Pythagoras' theorem is the usual UK name.
Can the answer be a decimal?
Yes, and it usually is. Only Pythagorean triples like 3, 4, 5 give whole numbers. Round to the accuracy the question asks for, or leave a square root for an exact answer.
How do I find the angles once I know the sides?
Use inverse sine, cosine or tangent. In the calculator, Solve gives all three angles in Measurements along with the sides, and Formulas shows SOH CAH TOA for the same triangle.

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
Read next
Maths · GeometryHypotenuse calculator: from two sides or a side and angleFind the hypotenuse of a right triangle from the two legs or from one side and an angle, with the formulas, special triangles and worked examples.