The Pythagorean Theorem

a2 + b2 = c2

In every right triangle, the square of the hypotenuse equals the sum of the squares of the two legs. Here you can see why it's true, learn to use it step by step, check your answers with a free calculator, and practise with worked examples and printable worksheets.

Open the calculatorLearn it from scratch

abc a² = 9 b² = 16 c² = 25
The 9 tiles on leg a and the 16 tiles on leg b exactly fill the 25-tile square on the hypotenuse c.

What the Pythagorean theorem says

The Pythagorean theorem is a rule about right triangles — triangles with one 90° angle. The two sides that form the right angle are the legs, a and b. The side opposite the right angle is the hypotenuse, c, and it is always the longest side. The theorem says the three lengths are linked by one equation:

a2 + b2 = c2

Read it as a statement about area. Build a square on each side of the triangle: the area of the square on the hypotenuse is exactly the area of the other two squares put together. In the 3-4-5 triangle above, 9 + 16 = 25. It works for every right triangle, of any size or shape — and for no other triangle.

In one sentenceIf you know two sides of a right triangle, the Pythagorean theorem gives you the third: c = √a2 + b2 for the hypotenuse, or a = √c2 − b2 for a leg.

New to it? Start with what the Pythagorean theorem is, then the formula and its rearrangements and how to spot the hypotenuse. The full step-by-step course takes you from the basics to the theorem in three dimensions and beyond.

Pythagorean theorem calculator

Type any two sides and leave the third box empty. You get the exact answer, the decimal, the angles and every step of the working.

c = 17

Exact answer.

  • Area60
  • Perimeter40
  • Angle A28.07°
  • Angle B61.93°
a = 8b = 15c = 17

Step-by-step solution

  1. Write the theorem: a2 + b2 = c2
  2. Substitute the two legs: 82 + 152 = c2
  3. Square each leg: 64 + 225 = c2
  4. Add: c2 = 289
  5. Take the square root (a length is never negative): c = √289 = 17

Need more? The full set of calculators includes a right triangle solver, a right-angle checker for three sides, a distance calculator and a 3D diagonal calculator.

See it for yourself

Drag the blue and orange handles to change the legs. The squares redraw as you go, and the equation underneath always balances. Try 6 and 8 for another whole-number answer, or 1 and 1 to meet √2; untick whole numbers only to explore any shape.

a = 3a² = 9b = 4b² = 16c = 5c² = 25

32 + 42 = 9 + 16 = 25, so c = √25 = 5

Drag the blue handle to change leg a (1 to 12) and the orange handle to change leg b (1 to 12).

Whatever shape you make, the blue and orange areas add up to the green one. That is the whole theorem — the rest of this site explains why it must be so and what you can do with it.

How to use it in three steps

  1. Find the hypotenuse. It is the side across from the right angle — the longest side. Call it c; the other two sides are a and b.
  2. Choose the right form. Missing the hypotenuse? Add the squares of the legs. Missing a leg? Subtract the square of the known leg from the square of the hypotenuse.
  3. Square root and check. Take the positive square root, then make sure the hypotenuse is still the longest side.

Example: how long is the ladder?

A ladder reaches 12 feet up a wall, and its foot stands 5 feet from the wall. The wall and the ground meet at a right angle, so the ladder is the hypotenuse.

c2= 52 + 122 = 25 + 144 = 169c= √169 = 13

The ladder is 13 feet long.

The step-by-step guide covers every case, including answers that are square roots. Then work through the worked examples, the word problems and the printable worksheets, and watch out for the most common mistakes.

Why it's true: more than 300 proofs

A few measured triangles can't prove a rule about all triangles — a proof can. The Pythagorean theorem has more proofs than any other theorem: Elisha Loomis collected 367 of them in The Pythagorean Proposition. The quickest to understand is the rearrangement proof: four copies of the triangle, arranged two ways inside the same big square, leave either c2 or a2 + b2 uncovered, so the two must be equal.

Others are worth knowing for what they teach: Euclid's windmill proof from around 300 BCE, the elegant similar-triangles proof, Bhāskara's "Behold!", the trapezoid proof of a future US president, and the trigonometric proofs found by two high-school students in 2022–23.

The converse and Pythagorean triples

The theorem also runs backwards. If three lengths satisfy a2 + b2 = c2, the triangle they make must have a right angle — the converse of the Pythagorean theorem. Builders use it to square corners: mark 3 feet along one wall and 4 along the other, and the diagonal between the marks must be exactly 5. If c2 is smaller than a2 + b2, the largest angle is acute; if larger, obtuse.

Whole numbers that fit the equation are called Pythagorean triples. They are worth memorising because they turn up again and again in homework and tests:

Triplea2b2c2Multiples
3, 4, 5916256-8-10, 9-12-15, 12-16-20
5, 12, 132514416910-24-26, 15-36-39
8, 15, 176422528916-30-34
7, 24, 254957662514-48-50
20, 21, 2940044184140-42-58

There are infinitely many; Euclid's formula generates all of them, and the complete list up to 100 and the triples generator let you look any of them up.

What is the Pythagorean theorem used for?

Any time you need a straight-line distance and can split it into two perpendicular parts, the theorem gives the answer. Carpenters check that foundations are square, firefighters place ladders, navigators work out how far a ship has really travelled, game engines measure the distance between characters every frame, and TV sizes are measured along the diagonal. The real-life uses page works through fifteen of them with numbers.

A theorem older than Pythagoras

The rule is named after Pythagoras of Samos, a Greek thinker of the 6th century BCE, but it was known long before him. A Babylonian clay tablet, Plimpton 322, lists Pythagorean triples about a thousand years earlier; India's Śulba Sūtras state the rule for laying out altars; and Chinese mathematicians knew it as the gougu theorem. Whether Pythagoras himself proved it is unknown — no writings by him survive. The first proof we still have is in Euclid's Elements. Read the whole story in the history of the Pythagorean theorem.

Frequently asked questions

What is the Pythagorean theorem in simple words?

In a right triangle, if you square the two shorter sides and add them, you get the square of the longest side. For a triangle with sides 3, 4 and 5: 32 + 42 = 9 + 16 = 25 = 52.

What is the formula for the Pythagorean theorem?

a2 + b2 = c2, where a and b are the legs and c is the hypotenuse. Rearranged, c = √a2 + b2 and a = √c2 − b2.

Does the Pythagorean theorem work for all triangles?

No — only for right triangles. For other triangles the law of cosines, c2 = a2 + b2 − 2abcosC, takes its place; when C = 90° the extra term is zero and you get the Pythagorean theorem back.

Who discovered the Pythagorean theorem?

Nobody knows. Babylonian scribes used Pythagorean triples around 1800 BCE, more than a thousand years before Pythagoras, and the rule was also known in ancient India and China. It carries Pythagoras' name because later Greek writers credited him or his followers with the first proof.

How do you find the hypotenuse?

Square each leg, add the squares and take the square root. For legs 9 and 40: √81 + 1600 = √1681 = 41. The hypotenuse calculator shows the working for any numbers.

Why is the Pythagorean theorem important?

It is the basis of how we measure distance. The distance formula, the length of vectors in physics, distances in 3D graphics and the trigonometric identity sin2θ + cos2θ = 1 are all the Pythagorean theorem in disguise.