A right-angled triangle drawn over a builder's square and ruler, showing the a squared plus b squared equals c squared relationship
Math · 7 min read

The Pythagorean theorem explained

Three letters, one of the most useful rules in all of math. Here is what a² + b² = c² means, how to use it both ways, and where it quietly shows up in real life.

Do the mathsPythagorean Theorem Calculator

Find the hypotenuse of a right triangle from the two shorter sides.

a b c
In a right triangle, the two shorter sides relate to the longest by a² + b² = c².

The Pythagorean theorem is one of those rules you meet once in school and then keep bumping into for the rest of your life, often without realising it. It connects the three sides of a right-angled triangle, and once you understand it you can find a distance you cannot measure directly, check whether a corner is truly square, or work out the diagonal of a screen. All of that comes from one short equation.

In short: the Pythagorean theorem says that in a right-angled triangle, a squared plus b squared equals c squared (a² + b² = c²), where c is the longest side. Square the two shorter sides, add them, and the result equals the square of the longest side. It lets you find any one side when you know the other two.

What a² + b² = c² actually says

In any right-angled triangle, the square of the longest side equals the squares of the other two sides added together. The longest side, called the hypotenuse, always sits opposite the right angle. We label the two shorter sides a and b, and the hypotenuse c, which gives the famous line:

a² + b² = c²

The key word is right-angled. The theorem only works when one angle is exactly 90 degrees. If the triangle has no right angle, this equation does not apply, and you need a different tool (the law of cosines) instead.

a b c
The hypotenuse (c) is always opposite the right angle. a and b are the two shorter sides.

How to find the hypotenuse

When you know the two shorter sides and want the long one, follow three steps:

  1. Square each short side.
  2. Add the two results together.
  3. Take the square root of that total.

As a formula: c = √(a² + b²).

Worked example: a triangle with legs of 6 and 8. c = √(6² + 8²) = √(36 + 64) = √100 = 10. So the hypotenuse is exactly 10.

Most real triangles do not give a tidy whole number, and that is fine. Legs of 4 and 7 give c = √(4² + 7²) = √(16 + 49) = √65 ≈ 8.06. You just round to the precision you need.

How to calculate a missing side (a leg)

It also works backwards. If you know the hypotenuse and one leg, subtract instead of add to find the other leg:

b = √(c² − a²)

Worked example: the hypotenuse is 13 and one leg is 5. b = √(13² − 5²) = √(169 − 25) = √144 = 12. The missing side is 12.

Why it works (and where it comes from)

The name comes from the Greek mathematician Pythagoras, around 500 BCE, though Babylonian clay tablets show the relationship was known over a thousand years earlier. The clearest way to see why it is true: draw a square on each of the triangle's three sides. The area of the square on the longest side turns out to be exactly equal to the two smaller squares combined.

You can check that with the 3-4-5 triangle: the square on side 3 has area 9, the square on side 4 has area 16, and the square on the hypotenuse (5) has area 25. Sure enough, 9 + 16 = 25. That is all a² + b² = c² is saying, in areas rather than lengths.

The converse: is a triangle right-angled?

The theorem also runs in reverse, which is genuinely useful. If the three sides of a triangle satisfy a² + b² = c², then the triangle must have a right angle, opposite the longest side. So to test a corner or a triangle, square the two shorter sides, add them, and see whether they equal the square of the longest. If 5, 12 and 13 are your sides, 25 + 144 = 169 = 13², so it is a right angle. If they do not match, it is not.

Common Pythagorean triples

Here is a quick Pythagorean triples list. A triple is a set of three whole numbers that fit the theorem perfectly, with no messy decimals. They are worth recognising because they turn up constantly in exams and on the job. The first four below are primitive triples (they do not come from scaling a smaller one); the last two are scaled versions of 3-4-5. Any multiple of a triple is also a triple.

abc (hypotenuse)CheckType
3459 + 16 = 25primitive
5121325 + 144 = 169primitive
8151764 + 225 = 289primitive
7242549 + 576 = 625primitive
681036 + 64 = 1003-4-5 × 2
9121581 + 144 = 2253-4-5 × 3

Where it actually gets used

This is not just a classroom exercise. The theorem shows up any time a right angle and a distance are involved:

Common mistakes to avoid

A quick way to check your answer

The hypotenuse must always be the largest of the three numbers, and it must be smaller than the two legs added together. If your c comes out longer than a + b, something has gone wrong. To skip the arithmetic entirely, enter any two sides into the Pythagorean theorem calculator and it returns the third, along with the working. For another everyday maths refresher, see our guide on how to work out a percentage.

Frequently asked questions

What is the Pythagorean theorem in simple terms?

In a right-angled triangle, the square of the longest side (the hypotenuse) equals the squares of the other two sides added together: a² + b² = c². It lets you find any one side when you know the other two.

How do I find the hypotenuse?

Square both shorter sides, add them, and take the square root: c = √(a² + b²). For legs of 6 and 8, c = √(36 + 64) = √100 = 10.

How do I find a missing shorter side?

Subtract instead of add: b = √(c² − a²). If the hypotenuse is 13 and one leg is 5, the other leg is √(169 − 25) = √144 = 12.

What are Pythagorean triples?

Whole-number side sets that fit the theorem exactly, like 3-4-5, 5-12-13 and 8-15-17. Any multiple of a triple is also a triple, so 6-8-10 works too.

Does the Pythagorean theorem work on any triangle?

No. It only works on right-angled triangles, where one angle is exactly 90 degrees. For other triangles you use the law of cosines.

How do I know if a triangle is right-angled?

Use the theorem in reverse: if a² + b² = c² for the three side lengths (c being the longest), the triangle has a right angle. For 5, 12, 13: 25 + 144 = 169 = 13², so it is right-angled.

Does the answer have to be a whole number?

No. Whole-number sets like 3-4-5 are the exception, not the rule. Most triangles give an irrational hypotenuse, such as legs 4 and 7 giving √65 ≈ 8.06. Just round to the precision you need.

Calculators in this article

Pythagorean Theorem Calculator

Find the hypotenuse of a right triangle from the two shorter sides.

Open

Percentage Calculator

Three common percentage questions in one place, pick a mode and type your numbers.

Open

Standard Deviation Calculator

Get the standard deviation, variance and mean of a data set.

Open

Average (Mean) Calculator

Enter a list of numbers to get the mean, median, sum and count.

Open