The Pythagorean theorem: a² + b² = c², explained with examples

The Pythagorean theorem says that in a right triangle, the square of the longest side equals the sum of the squares of the other two: a² + b² = c². Know any two sides and you can always find the third. I built the Pythagorean theorem calculator to do exactly that with the working shown, and this guide explains how the formula works, why it is true and where people trip up.

What the theorem says

A right triangle has one angle of exactly 90°. The two sides that form that angle are the legs, usually called a and b, and the side opposite it is the hypotenuse, c. The hypotenuse is always the longest side. The theorem links the three: a² + b² = c². With legs of 3 and 4, 3² + 4² = 9 + 16 = 25, and √25 = 5, so the hypotenuse is 5.

It also works in reverse. If the sides of any triangle satisfy a² + b² = c², the angle opposite c must be a right angle. If a² + b² is bigger than c² (with c the longest side), the triangle is acute; if it is smaller, the triangle is obtuse.

Finding a missing side

There are two cases, and the only difference is whether you add or subtract:

  • Missing hypotenuse: c = √(a² + b²). Legs of 5 and 12 give √(25 + 144) = √169 = 13.
  • Missing leg: a = √(c² − b²). A 5 m ladder with its foot 3 m from a wall reaches √(25 − 9) = √16 = 4 m up the wall.

Most answers are not whole numbers. A square with sides of 1 has a diagonal of √2 ≈ 1.4142, an irrational number that never ends, so you round to suit the job; Significant figures: the rules, with examples covers how many digits to keep. The calculator accepts any two sides, rounds to four decimal places, draws the triangle to scale and refuses a hypotenuse that is not longer than the leg you gave, because no such triangle exists. For square roots on their own, the square root calculator gives more digits and simplified radicals.

Why it is true

There are hundreds of proofs. The quickest to picture uses a large square with side a + b. Place four copies of the triangle inside it, one in each corner, so that their hypotenuses form a tilted square of side c in the middle. The area of the big square can be counted two ways:

  • as one square: (a + b)² = a² + 2ab + b²;
  • as four triangles plus the middle square: 4 × ½ab + c² = 2ab + c².

Setting them equal and cancelling 2ab leaves a² + b² = c². The result is named after Pythagoras, but Babylonian tablets from around 1800 BC already list sets of numbers that fit it.

Pythagorean triples

A Pythagorean triple is three whole numbers that fit the formula exactly. The familiar ones are worth recognising on sight:

  • 3, 4, 5 and its multiples, such as 6, 8, 10 and 30, 40, 50;
  • 5, 12, 13;
  • 8, 15, 17;
  • 7, 24, 25;
  • 20, 21, 29.

You can generate as many as you like with Euclid's formula: pick whole numbers m greater than n, then m² − n², 2mn and m² + n² form a triple. m = 2, n = 1 gives 3, 4, 5; m = 3, n = 2 gives 5, 12, 13.

Everyday uses

The theorem quietly answers a lot of practical questions:

  • Squaring a corner. Builders mark 3 units along one wall and 4 along the other; if the diagonal measures 5, the corner is square.
  • Screen sizes. A 55-inch TV is measured on the diagonal. At a 16:9 shape it is about 47.9 inches wide and 27.0 inches tall.
  • Distance on a grid. The straight-line distance from (1, 2) to (7, 10) is √(6² + 8²) = √100 = 10, the basis of the distance formula.
  • Three dimensions. Apply it twice and the diagonal of a box is √(a² + b² + c²): a 3 × 4 × 12 box has a 13-unit diagonal.

Common mistakes

The most common slip is adding when you should subtract: if you know the hypotenuse, the missing leg comes from c² − b², not c² + b². The second is forgetting the square root at the end, leaving 25 instead of 5. The third is using the theorem on a triangle without a right angle. For any other triangle, the law of cosines, c² = a² + b² − 2ab·cos C, takes over, and the triangle solver handles every combination of sides and angles. If you need the area from three sides, the area calculator uses Heron's formula.

Sources and further reading

The claims in this guide rest on these references, which were checked when the guide was last updated. Spotted an error? The contact page says how to report it.

  1. Pythagorean theorem — Wikipedia (proofs and history)
  2. Pythagorean triple — Wikipedia (Euclid's formula)
  3. Pythagorean Theorem — Wolfram MathWorld

Try the tool

Frequently asked questions

What is the Pythagorean theorem in simple terms?

In a right triangle, the square of the longest side equals the sum of the squares of the other two sides: a² + b² = c².

How do I find the hypotenuse?

Square both legs, add them and take the square root. Legs of 3 and 4 give √25 = 5.

Does the Pythagorean theorem work for all triangles?

No, only for right triangles. For other triangles use the law of cosines.

What is a Pythagorean triple?

Three whole numbers that fit a² + b² = c² exactly, such as 3, 4, 5 or 5, 12, 13.