What the theorem says, and what it does not
In a right triangle, the square built on the hypotenuse has exactly the same area as the two squares built on the legs added together: a² + b² = c². That statement is about areas, not lengths, which is why the squares are there and why the relationship cannot be simplified to a + b = c.
The theorem applies only when one angle is exactly 90°. Feed it a triangle without a right angle and it gives a wrong answer with no complaint. For those, use the law of cosines calculator, whose formula is this one plus a correction term that vanishes at 90°.
Just as useful is the converse, proved as the last proposition of Euclid's first book: if three lengths satisfy a² + b² = c², then the angle opposite c must be a right angle. That is what turns the theorem into a measuring tool. Mark 3 units along one line and 4 along another, and if the diagonal between the marks reads exactly 5, the corner is square. No instrument is needed, only a tape — which is why the 3-4-5 method has been standard on building sites for millennia.
The same relationship is the distance formula in disguise. The gap between two points is √((Δx)² + (Δy)²), which is the hypotenuse of the right triangle formed by their horizontal and vertical separations. See the distance formula calculator.
Three problems, one identity
Finding the hypotenuse. Square both legs, add, take the root: c = √(a² + b²). The result is always longer than either leg but shorter than their sum, and for two equal legs it is exactly s√2 ≈ 1.4142s.
Finding a leg. Subtract instead: a = √(c² − b²). This requires c > b; a hypotenuse shorter than a leg describes no triangle, and the calculator rejects it rather than returning the root of a negative number.
Checking for square. Compute a² + b² − c². Zero means a right angle. Positive means the sum of the leg squares is too large for the measured diagonal, so that diagonal is short and the corner is acute. Negative means the diagonal is long and the corner is obtuse. The calculator reports both the deviation and the diagonal a square corner would require, which is the number you actually adjust to.
Because the relationship is homogeneous in length, right triangles scale exactly: multiply all three sides by any factor and the identity still holds. That is why 3-4-5, 6-8-10, 9-12-15 and 12-16-20 are all valid squaring checks — pick the one that fits the space, and prefer the largest that fits, since a longer baseline reduces the angular effect of a given measuring error.
Integer solutions like 3-4-5 are called Pythagorean triples. Every primitive one is generated by a = m² − n², b = 2mn, c = m² + n² for coprime integers m > n of opposite parity: m = 2, n = 1 gives 3-4-5; m = 3, n = 2 gives 5-12-13; m = 4, n = 1 gives 15-8-17.
Worked example: bracing a wall and squaring a slab
Part one: a diagonal brace. A wall frame is 8.000 ft tall and 10.000 ft long, and you need a brace corner to corner.
- Square the legs. 8² = 64 and 10² = 100.
- Add. 64 + 100 = 164.
- Root. c = √164 = 12.8062 ft, which is 12 ft 911⁄16 in.
- Angles. The brace meets the bottom plate at arctan(8/10) = 38.6598°, and the top at 51.3402°.
- Area enclosed. ½ × 8 × 10 = 40 ft².
Part two: squaring a slab. You have formed a slab intended to be 12 ft by 16 ft, and the measured diagonal is 20.125 ft.
- What a square corner needs. √(12² + 16²) = √(144 + 256) = √400 = 20.000 ft exactly — 12-16-20 is 3-4-5 scaled by four.
- Deviation. a² + b² − c² = 400 − 405.0156 = −5.0156. Negative, so the diagonal is long and the corner is obtuse.
- How far out. The corner angle is arccos[(12² + 16² − 20.125²)/(2 × 12 × 16)] = arccos(−0.013062) = 90.7485°, so the form is 0.75° out of square.
- The fix. Racking the frame until the diagonal reads 20.000 ft squares it. The 0.125 ft of diagonal error corresponds to that three-quarters of a degree, which is the useful sensitivity of this test: on a 20 ft diagonal, one inch of error is roughly 0.5°.
Using the deviation number in the field
The sign of a² + b² − c² tells you which way to push. Positive means the measured diagonal is shorter than a square corner requires, so the corner is acute and the frame needs opening up. Negative means the diagonal is longer than required, the corner is obtuse, and the frame needs closing. The magnitude of the deviation is in squared units and is not intuitive on its own, which is why the calculator also gives the diagonal a square corner would need — that is the number to chase with a tape.
Choose the largest triple your space allows. The angular effect of a fixed tape error scales as 1/baseline: a 1/16-inch error on a 3-4-5 check laid out in feet gives dθ = c·dc/(ab) = 60 × 0.0625 / (36 × 48) = 0.0022 rad, about 0.12°, while the same error on a 12-16-20 check gives exactly a quarter of that, about 0.03°. Squaring a 20 ft form off a 3-4-5 triangle throws away that factor of four, so the small triple should be a last resort.
Two practical cautions on measurement. First, everything must be measured along the same plane: a diagonal taken across a sloping site is longer than the plan diagonal and will report a square corner as obtuse. Second, tape sag and tension matter over long spans — a loose tape reads long, which biases the check toward "obtuse" every time.
On angles: the two acute angles always sum to 90°, so finding one gives the other. Their tangent is the ratio of the legs, which is the same quantity a builder calls slope or pitch. A 4-in-12 roof is a right triangle with legs 4 and 12, hypotenuse √160 = 12.6491, and a pitch angle of arctan(4/12) = 18.4349°.
Pythagorean triples and common right triangles
| Legs a, b | Hypotenuse c | a² + b² | Angle opposite a |
|---|---|---|---|
| 3, 4 | 5 | 9 + 16 = 25 | 36.8699° |
| 5, 12 | 13 | 25 + 144 = 169 | 22.6199° |
| 8, 15 | 17 | 64 + 225 = 289 | 28.0725° |
| 7, 24 | 25 | 49 + 576 = 625 | 16.2602° |
| 20, 21 | 29 | 400 + 441 = 841 | 43.6028° |
| 9, 40 | 41 | 81 + 1600 = 1681 | 12.6804° |
| 1, 1 | 1.4142136 | 1 + 1 = 2 | 45.0000° |
| 1, 1.7320508 | 2 | 1 + 3 = 4 | 30.0000° |
| 4, 12 | 12.6491106 | 16 + 144 = 160 | 18.4349° |
The last row is a 4-in-12 roof pitch. Every integer row can be scaled by any factor and still works as a squaring check — 12-16-20 is the 3-4-5 row times four.
Mistakes that produce a wrong length or a false square
- Adding the legs instead of their squares. a + b is always larger than c. For 3 and 4 that gives 7 rather than 5.
- Forgetting the square root. The formula produces c². Reporting 164 instead of 12.806 is a common slip on the last step.
- Applying it to a triangle with no right angle. The identity holds only at 90°. Anywhere else you need the law of cosines.
- Treating a leg as the hypotenuse. The hypotenuse is always the longest side and always opposite the right angle. Subtracting in the wrong order gives the root of a negative number.
- Squaring a large layout with a small triple. A 3-4-5 check on a 20-foot form multiplies your tape error into the corner angle. Use the largest triple the space allows.
- Measuring a diagonal across a slope. Slope distance exceeds plan distance, so a level-plane square corner will read as obtuse. Measure horizontally or correct for the grade.
Where the theorem leads next
The theorem generalises in two directions worth knowing. Sideways, into the law of cosines: c² = a² + b² − 2ab·cos C, which reduces to Pythagoras when C = 90° and quantifies the departure otherwise. Upwards, into three dimensions: the diagonal of a rectangular box is √(l² + w² + h²), which is the theorem applied twice, and the 3D distance calculator does exactly that.
For a complete right triangle including both angles, the altitude to the hypotenuse and the inradius, use the right triangle calculator. Two right triangles turn up so often that they have their own tools: the 30-60-90 triangle calculator and the 45-45-90 triangle calculator, whose side ratios are 1 : √3 : 2 and 1 : 1 : √2.
The theorem also produced the first known irrational number. Set both legs to 1 and the hypotenuse is √2, which cannot be written as a ratio of whole numbers — a discovery attributed to the Pythagorean school itself and one that forced Greek mathematics to separate number from magnitude. Every diagonal of a square you measure is a physical instance of it. For coordinate work, the same identity becomes the distance formula, and in trigonometry it becomes the identity sin²θ + cos²θ = 1, which is just the theorem applied to a right triangle with a hypotenuse of one.
