The Pythagorean theorem, explained
What a squared plus b squared equals c squared really means, the common whole-number triples, a proof you can picture, and where the theorem shows up in real work.
The Pythagorean theorem is one sentence long and about 2,500 years old, and it still decides whether a deck is square, how long a roof rafter needs to be, and how far apart two points sit on a map. It is also one of the few pieces of school mathematics that people use by hand, on purpose, in their jobs. What follows is the idea, a proof you can actually picture, the numbers worth memorising, and the mistakes that catch people out.
What a² + b² = c² actually says
The theorem applies to right triangles — triangles with one 90° corner. The two sides that meet at that corner are called the legs, conventionally labelled a and b. The side opposite the right angle is the hypotenuse, labelled c. It is always the longest side.
The theorem states that the square of the hypotenuse equals the sum of the squares of the legs:
a² + b² = c²
Read geometrically, it says something surprisingly concrete: if you build a square on each of the three sides, the area of the square on the hypotenuse equals the combined area of the squares on the two legs. It is a statement about areas, not just about lengths. That is the picture to hold on to.
Because it can be rearranged, the theorem finds any side if you know the other two. To find the hypotenuse, square both legs, add, then take the square root: c = √(a² + b²). To find a leg, subtract instead: a = √(c² − b²). The subtraction version is why the hypotenuse must be the longest side — if you feed in a leg longer than the hypotenuse, the value under the root goes negative, and the free Pythagorean calculator reports that the hypotenuse must be the longest side rather than returning a nonsense answer.
A proof you can picture
There are hundreds of proofs, but one is easy to see without any algebra beyond expanding a bracket. It is the rearrangement proof.
Take four identical right triangles with legs a and b and hypotenuse c, and arrange them inside a large square whose sides are a + b. Point the hypotenuses inward; the four triangles leave an empty tilted square in the middle whose sides are exactly c.
Now count areas two ways:
- The large square has side (a + b), so its area is (a + b)² = a² + 2ab + b².
- The four triangles together have area 4 × (ab ÷ 2) = 2ab.
- The empty middle square is the large square minus the triangles: a² + 2ab + b² − 2ab = a² + b².
- But that middle square is built on the hypotenuse, so its area is c².
Therefore c² = a² + b². Check it with the 3-4-5 triangle: the large square has side 7 and area 49; the four triangles total 2 × 3 × 4 = 24; the remaining square is 49 − 24 = 25, and √25 = 5. The arithmetic lands exactly where the theorem says it should.
Worked examples
The mechanics are always the same: identify the hypotenuse, square the known sides, add or subtract, and take the root at the end.
- Missing hypotenuse: legs 3 and 4. c = √(3² + 4²) = √(9 + 16) = √25 = 5.
- Missing leg: leg 9, hypotenuse 15. a = √(15² − 9²) = √(225 − 81) = √144 = 12.
- Rafter length: a roof rises 6 inches over a 12-inch run. The rafter is the hypotenuse: √(36 + 144) = √180 ≈ 13.42 inches per foot of run.
- Distance between points: (1, 2) and (4, 6). The horizontal gap is 3 and the vertical gap is 4, so the straight-line distance is √(9 + 16) = 5.
- Space diagonal of a box: a 2 × 3 × 6 box has body diagonal √(4 + 9 + 36) = √49 = 7.
Whole-number triples worth knowing
Most right triangles have at least one irrational side, but a special family has three whole numbers. These are Pythagorean triples. The smallest is 3-4-5, and every multiple of a triple is also a triple — 6-8-10, 9-12-15, and so on — which is exactly why they are useful on a job site.
| Triple (a, b, c) | Check | Multiple commonly used |
|---|---|---|
| 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 |
Primitive triples (those with no common factor) can be generated from any pair of whole numbers m > n with a = m² − n², b = 2mn, and c = m² + n². For m = 3 and n = 2 that gives a = 5, b = 12, c = 13. For m = 4 and n = 3 it gives 7, 24, 25. This is why both 3-4-5 and 20-21-29 are whole-number right triangles: they are built by the same rule.
The 3-4-5 method for squaring a corner
The converse of the theorem is just as useful as the theorem itself: if the three sides of a triangle satisfy a² + b² = c², then the angle between the two shorter sides is exactly 90°. Builders use this to lay out a square corner without a square.
- From the corner, measure 3 units along one direction and mark it.
- Measure 4 units along the other direction and mark it.
- Measure the diagonal between the two marks. If it is exactly 5 units, the corner is square. If it is longer or shorter, the corner is open or closed and needs adjusting.
Scale the numbers up to reduce the effect of measurement error: 6-8-10, 9-12-15, or 3 m / 4 m / 5 m for larger layouts. The greater the multiple, the smaller the fraction of the total that a millimetre of tape error represents, and the more accurate the resulting corner. Keep the tape taut and measure the diagonal to the same tolerance you want in the frame. For slab and footing layouts, the concrete calculator handles the volume once the corners are true.
The theorem in three dimensions
Apply the theorem twice and it extends to space. In a rectangular box with width x, depth y, and height z, the diagonal of the base is √(x² + y²). That diagonal and the height form a new right triangle, so the body diagonal is:
d = √(x² + y² + z²)
For the 2 × 3 × 6 box above, that is √(4 + 9 + 36) = √49 = 7. The same pattern — a sum of squares under a single root — gives the distance formula in the plane, √((x₂ − x₁)² + (y₂ − y₁)²), and its three-dimensional counterpart. Computer graphics, navigation, and physics all lean on it constantly.
Roof pitch: Pythagoras on a roof
Roof pitch is rise over run, usually written as inches of rise per 12 inches of horizontal run. A 6/12 pitch rises 6 inches for every 12 inches across. That slope is the leg ratio of a right triangle, and the slope factor — the number you multiply a flat plan area by to get the true sloped surface area — is just the hypotenuse divided by the run:
slope factor = √(1 + (rise ÷ run)²)
For a 6/12 pitch the ratio is 0.5, so the slope factor is √(1 + 0.25) = √1.25 ≈ 1.118. A 1,200 square-foot footprint therefore has about 1,342 square feet of roof surface. Steeper pitches raise the factor: 12/12 gives √2 ≈ 1.414, roughly 41% more material than the footprint. The roof pitch calculator converts rise and run into pitch, degrees, grade, and slope factor, and the rafter length example above is the same calculation seen from the other direction.
Common errors
- Using it on a non-right triangle. The theorem is only valid when one angle is exactly 90°. For other triangles you need the law of cosines, c² = a² + b² − 2ab·cos(C).
- Confusing which side is the hypotenuse. It is always the longest side, opposite the right angle. If a computed result is shorter than a known side, something is wrong.
- Forgetting the final square root. 9 + 16 = 25 is the square of the answer; the side length is √25 = 5. Reporting 25 is the single most common slip.
- Mixing units. Feet, inches, and metres cannot be added before squaring unless they are converted first. Convert the legs to one unit, then compute.
- Feeding a leg longer than the hypotenuse. The subtraction inside √(c² − b²) turns negative, and no real triangle exists. The calculator flags this instead of producing a value.
- Trusting a rough diagonal measurement. The 3-4-5 check only tells you the corner is square to the accuracy of the longest measurement. Stretch the tape and repeat before committing.
Frequently asked questions
Does the theorem work in any units?
Yes, as long as all three sides are measured in the same unit. The theorem is a statement about ratios of lengths, so it is unit-agnostic. Feet, metres, or a custom unit all work, but you must not mix them within one calculation.
Is 5-12-13 a Pythagorean triple?
Yes. 5² + 12² = 25 + 144 = 169 = 13². It is a primitive triple and is common in construction because the numbers stay manageable while giving a more accurate corner than 3-4-5.
What if the triangle is not a right triangle?
The theorem does not apply, and using it will give an answer that is too small or too large. Use the law of cosines instead, which reduces to the Pythagorean theorem when the angle between the two known sides is 90°.
Why is the hypotenuse always the longest side?
Because it is the sum of two squares under a root. Adding a positive leg squared to another positive leg squared always produces more than either leg squared alone, so √(a² + b²) is always greater than both a and b. That is also why the calculator can reject a hypotenuse shorter than a leg.