Pythagorean Theorem
calculator.
Find the third side of a right triangle, or check if a corner is square.
9, 12 and 15 are all whole numbers, so they form a Pythagorean triple. The two acute angles are 36.87° and 53.13°.
a and b meet at the right angle; c is the longest side, opposite it.
Squares on the sides
Drag a brass vertex to change a legRight triangle with legs a = 9 and b = 12 and hypotenuse c = 15. The squares on the legs have areas 81 and 144, which add up to the square on the hypotenuse, 225.
Working
- 1The theorem, with c the hypotenuse opposite the right anglea² + b² = c²
- 2Add the squares of the legsc² = 9² + 12² = 81 + 144 = 225
- 3Take the square rootc = √225 = 15
- 4Check: put all three sides back in9² + 12² = 225 and 15² = 225
- 5Answerc = 15
What if a changes
| a | c | Angle A |
|---|---|---|
| 6 | 13.4164 | 26.57° |
| 7 | 13.8924 | 30.26° |
| 8 | 14.4222 | 33.69° |
| 9(yours) | 15 | 36.87° |
| 10 | 15.6205 | 39.81° |
| 11 | 16.2788 | 42.51° |
| 12 | 16.9706 | 45° |
With b fixed at 12, moving a from 6 to 12 takes c from 13.4164 to 16.9706.
Keyboard shortcuts
- Up and Down in a number box change it by 1. Hold Shift for 10, Alt for 0.1.
- Tab to a brass vertex, then use Left and Right for b or Up and Down for a. Shift moves ten times as far.
- Left and Right switch the task, Exact or Decimal, and decimal places.
- In the list below, paste two columns copied from a spreadsheet into the first box.
Solve a list of triangles
Type or paste rows of a and b, for example a cut list of rafters or braces. Each row gets its hypotenuse, following the Solve for choice above.
| # | Leg a | Leg b |
|---|---|---|
| 1 | ||
| 2 | ||
| 3 |
Hypotenuse c for each row
| a, b | c | Angle A |
|---|---|---|
| 9, 12 | 15 | 36.87° |
| 5, 12 | 13 | 22.62° |
| 8, 15 | 17 | 28.07° |
Primitive triples
| c | a | b |
|---|---|---|
| 5 | 3 | 4 |
| 13 | 5 | 12 |
| 17 | 8 | 15 |
| 25 | 7 | 24 |
| 29 | 20 | 21 |
| 37 | 12 | 35 |
Every primitive triple with a hypotenuse up to 100, from Euclid's formula.
How it’s worked out
A right triangle has one 90° corner. The two sides that meet there are the legs, a and b. The side across from the corner is the hypotenuse, c, and it is always the longest side. The theorem links the three:
In words, the square drawn on the hypotenuse has the same area as the two squares on the legs put together. The drawing under the tool shows exactly that, to scale. For legs 9 and 12, c² = 9² + 12² = 81 + 144 = 225, and the hypotenuse is √225 = 15.
To find a missing side, the tool rearranges the theorem. The hypotenuse adds the squares; a leg subtracts the known leg's square from the hypotenuse's:
For a leg, the engine works out (c − b)(c + b) instead of c² − b². The two are equal, but the first keeps its accuracy when the leg is very short next to the hypotenuse.
When both known sides are whole numbers, the number under the root is whole too, so you also get an exact answer. The tool pulls out every square factor: two legs of 10 give c = √200 = 10√2, about 14.1421. Some roots, such as √721, have no square factor and stay as they are.
The theorem also runs backward (Euclid, Elements I.48). Square the two shorter of three lengths and compare the total with the square of the longest. Equal means a right angle. A larger total means every angle is under 90°, and a smaller one means the corner opposite the longest side is over 90°. The Check task does this and also gives the real angle from the law of cosines.
The other two tasks reuse the same rule. Euclid's formula builds whole-number triples from any whole numbers m > n: m = 4 and n = 1 give 8, 15, 17. A box applies the theorem twice, first across the floor and then up to the far top corner:
A box 24 by 18 by 16 inches has a floor diagonal of 30 in and a space diagonal of 34 in, the longest rod that fits inside.
Worked examples
How tall is a 55 inch TV?
Maya is buying a TV for an alcove. Screen sizes are measured on the diagonal, so her 55 inch screen has c = 55, and the spec sheet says it is 48 inches wide. The height is the missing leg.
The tool subtracts the squares: a² = c² − b² = 3,025 − 2,304 = 721, so a = √721 = 26.85 in. The root does not simplify, because 721 has no square factor. That is the glass alone, about 26.9 inches, so Maya adds the frame before she measures the alcove.
How high does a 16 foot ladder reach?
Sam sets a 16 ft ladder with its foot 4 ft out from the wall. The ladder is the hypotenuse and the gap at the floor is one leg, so the reach up the wall is the other leg. The squares give a² = c² − b² = 256 − 16 = 240, so the reach is √240 = 4√15, or 15.49 ft.
The angle with the ground is 75.52°. That is the angle OSHA's rule for leaning ladders aims at: one foot out for every four feet of working length (29 CFR 1926.1053). Moving the foot out lowers both the reach and the angle, and the what-if table under the tool shows how fast.
Is the deck frame square?
Luis marks 6 ft along one joist and 8 ft along the other, then measures 10.1 ft between the marks. This is the 3-4-5 check scaled up by 2. The two short sides give 6² + 8² = 100, but the diagonal gives 10.1² = 102.01.
The total is smaller, so the corner is obtuse: it measures 91.2°, opened about 1.2° past square. A square corner needs a diagonal of exactly 10 ft, so Luis pushes the frame until the tape reads 10 ft.
Reading your result
The missing side comes in the unit you picked. With Exact on and whole-number sides, it shows as a root, such as 4√15 in the ladder example, with the decimal beside it. Use the root for homework and the decimal for cutting or buying. With decimal sides, only the decimal is shown.
A whole-number answer means your three sides form a Pythagorean triple, such as 3, 4, 5 or 5, 12, 13. Multiples of a triple are triples too, so 9, 12, 15 is 3, 4, 5 times three.
The two angles beside the answer always add up to 90°. Angle A sits opposite leg a and angle B opposite leg b. The bigger angle faces the longer leg.
In the Check task, small errors in a tape reading show up as small changes in the corner. For marks at 6 and 8 ft, this is what each diagonal means:
| Diagonal (ft) | a² + b² | c² | Corner |
|---|---|---|---|
| 9.8 | 100 | 96.04 | acute, 87.64° |
| 9.9 | 100 | 98.01 | acute, 88.81° |
| 10 | 100 | 100 | right, 90° |
| 10.1 | 100 | 102.01 | obtuse, 91.2° |
| 10.2 | 100 | 104.04 | obtuse, 92.41° |
A tenth of a foot, about an inch and a quarter, moves this corner by roughly 1.2°. On a long wall that shows, so measure the diagonal to the nearest eighth of an inch.
A near miss is still a miss. The tool calls a corner right only when the two sides of the equation agree to about one part in a billion. Sides 1, 1 and 1.4142 give 2 against 1.999962, so the result is acute: 1.4142 is close to √2 but not equal to it.
Common mistakes
- Putting the hypotenuse in a leg box. c is the side across from the right angle. On a ladder it is the ladder itself, and on a TV it is the diagonal. If you enter a leg longer than c, the tool stops and says so.
- Adding when you should subtract. For a missing leg, take the known leg's square away from c². Adding gives √(55² + 48²) = 73 for the TV, longer than its own diagonal, which is impossible.
- Using it on a corner that is not 90°. The theorem only holds for right triangles. For any other triangle use the law of cosines, which the triangle solver handles.
- Mixing units. 6 ft 3 in is 6.25 ft, not 6.3 ft. Convert every side to one unit first, or switch the unit box and let the tool convert what you typed.
- Rounding before the square root. Keep the full value of a² + b² until the last step. Rounding a square early can move the answer in the second decimal place.
Questions people ask
Sources
- Euclid, Elements, Book I, Propositions 47 and 48 (the theorem and its converse)
- Weisstein, E. W., Pythagorean Triple, MathWorld (Wolfram Research)
- OSHA, 29 CFR 1926.1053(b)(5)(i): non-self-supporting ladders set at a 1 to 4 horizontal-to-working-length ratio