Calc Garden

Plot No. 61 · Education

Pythagorean Theorem Calculator

Find the missing side of a right triangle using the Pythagorean theorem, a squared plus b squared equals c squared. Enter the two legs to get the hypotenuse, or enter the hypotenuse and one leg to get the other leg, with the equation shown for each answer.

Inputs
Solve for
Results
Hypotenuse (c)5.0000

c = sqrt(3^2 + 4^2) = sqrt(25) = 5.0000

The Pythagorean theorem only applies to right-angled triangles, where a squared plus b squared equals c squared.

The link saves your inputs so you can bookmark or share this exact result.

3 squared plus 4 squared, and two ways to get it wrong

3 squared is 9 and 4 squared is 16, so 3 squared plus 4 squared is 25, and its square root, 5, is the hypotenuse. The order is what trips people up: square each leg, add the squares, then take one square root at the end. Two shortcuts look plausible and both give 7 instead of 5. Adding the legs first gives (3 + 4) squared, which is 49, because (a + b) squared expands to a squared plus 2ab plus b squared and carries an extra 2 times 3 times 4, or 24. Taking square roots term by term gives the square root of 9 plus the square root of 16, which is just 3 plus 4 again. 7 is the distance along both legs, and the diagonal is always shorter than that, which makes a quick check on any answer.

Pythagorean triples: right triangles with whole-number sides

A Pythagorean triple is a set of three whole numbers that fit a squared plus b squared equals c squared exactly. The table lists every primitive triple (one with no common factor) whose hypotenuse is 65 or less. Multiplying all three numbers in a row by the same amount gives another triple, so 3, 4, 5 also produces 6, 8, 10 and 9, 12, 15, and these scaled versions are the ones that turn up most in exam questions and on building sites.

aba squaredb squareda squared + b squaredc
34916255
5122514416913
8156422528917
7244957662525
202140044184129
12351441225136937
940811600168141
28457842025280953
11601213600372161
16632563969422565
335610893136422565

65 appears twice because it is the smallest number that is the hypotenuse of two different primitive triples, 16, 63, 65 and 33, 56, 65.

Hypotenuse for common leg lengths

Most pairs of whole-number legs do not give a whole-number hypotenuse, and the answer is an irrational number that the calculator rounds to four decimal places. When both legs are equal the triangle has two 45 degree angles and the hypotenuse is always the leg times the square root of 2, about 1.4142, which is also the diagonal of a square with that side.

Legsa squared + b squaredHypotenuse c
1 and 11 + 1 = 2square root of 2 = 1.4142
1 and 21 + 4 = 5square root of 5 = 2.2361
2 and 24 + 4 = 8square root of 8 = 2.8284
2 and 34 + 9 = 13square root of 13 = 3.6056
3 and 39 + 9 = 18square root of 18 = 4.2426
4 and 416 + 16 = 32square root of 32 = 5.6569
4 and 516 + 25 = 41square root of 41 = 6.4031
5 and 525 + 25 = 50square root of 50 = 7.0711
5 and 625 + 36 = 61square root of 61 = 7.8102
6 and 736 + 49 = 85square root of 85 = 9.2195
10 and 10100 + 100 = 200square root of 200 = 14.1421
10 and 20100 + 400 = 500square root of 500 = 22.3607

Checking a right angle with the 3-4-5 rule

The theorem also works in reverse. If the three sides of a triangle satisfy a squared plus b squared equals c squared, the angle between a and b is exactly 90 degrees. Builders, tilers and gardeners use this to set out a square corner without a large set square: measure 3 units along one side and 4 along the other, and adjust until the diagonal between the two marks is exactly 5. The same check scales to 0.6, 0.8 and 1.0 metres for a small job or 6, 8 and 10 feet for a slab or a deck. Setting out a floor this way before working out how many tiles it needs with the tile calculator stops the cut row along the far wall from tapering.

If the diagonal comes out long, the corner is wider than 90 degrees (obtuse), because a squared plus b squared is then less than c squared. If it comes out short, the corner is too tight (acute). For sides of 3 and 4, a diagonal of 5.1 means the corner is obtuse, since 25 is less than 26.01, and 4.9 means it is acute, since 25 is more than 24.01.

How high a ladder reaches

A ladder leaning on a wall is a right triangle: the ladder is the hypotenuse, the wall is one leg and the ground between the wall and the foot is the other. Ladder safety guidance in both the UK and the US uses the 1 in 4 rule, which puts the foot about a quarter of the ladder's working length out from the wall, giving an angle of roughly 75 degrees. The height reached is then the square root of the length squared minus the quarter-length squared, which works out at about 97 percent of the ladder's length whatever the unit.

Ladder lengthFoot out from wallHeight reached
30.752.90
413.87
51.254.84
61.505.81
827.75
102.509.68
12311.62
16415.49
20519.36

Lengths are in any one unit, metres or feet. Height reached is where the top of the ladder touches the wall, not a safe standing height, and the guidance also asks for the top to extend past a landing point you step off at. Check the label on your own ladder.

TV and monitor screen sizes

Screens are sold by their diagonal, which is the hypotenuse of the triangle formed by the width and the height. A 16:9 screen is a 16 by 9 right triangle scaled up, and its diagonal is the square root of 256 plus 81, which is the square root of 337, about 18.3576. Dividing the advertised size by that figure and multiplying by 16 and by 9 gives the width and the height. The ratio calculator handles other aspect ratios.

Diagonal (inches)Width (inches)Height (inches)
3227.915.7
4337.521.1
5043.624.5
5547.927.0
6556.731.9
7565.436.8
8574.141.7

These are screen dimensions. The bezel and stand add to the footprint, so check the manufacturer's spec sheet before buying for a tight alcove.

Distance between two points

The distance formula from coordinate geometry is the Pythagorean theorem in disguise. The horizontal gap between two points is one leg, the vertical gap is the other, and the straight line between them is the hypotenuse, so the distance is the square root of the x difference squared plus the y difference squared. From (1, 2) to (7, 10) the gaps are 6 and 8, and the distance is the square root of 36 plus 64, which is 10. Enter the two gaps as the legs above to get any other distance. In three dimensions the same idea adds a third squared gap under the square root, so the diagonal of a 3 by 4 by 12 box is 13.

How the Pythagorean theorem is applied

The Pythagorean theorem says that in a right-angled triangle the square of the hypotenuse equals the sum of the squares of the two shorter sides, written a squared plus b squared equals c squared. This calculator works in two directions. In hypotenuse mode it squares both legs, adds them and takes the square root to find c. In leg mode it subtracts the square of the known leg from the square of the hypotenuse and takes the square root to find the missing leg.

Because the hypotenuse is always the longest side, leg mode requires the entered hypotenuse to be longer than the known leg; otherwise the squared difference would be negative and no real triangle exists, so the calculator shows a guard message. Each answer is given to four decimal places along with the exact equation used.

How to use the Pythagorean theorem calculator

  1. Pick whether you want to solve for the hypotenuse or for a missing leg.
  2. In hypotenuse mode enter the two legs; in leg mode enter the hypotenuse and the leg you already know.
  3. Read the missing side and the equation that produced it as you type.

Worked examples

Finding the hypotenuse

Inputs: Legs of 3 and 4

Result: c equals the square root of 9 plus 16, which is the square root of 25, so the hypotenuse is exactly 5.

Finding a missing leg

Inputs: Hypotenuse 13, known leg 5

Result: The leg equals the square root of 169 minus 25, which is the square root of 144, so the missing leg is exactly 12.

Limitations and common mistakes

Edge cases and limitations

  • It only applies to right-angled triangles; it cannot solve triangles without a 90 degree angle.
  • In leg mode the hypotenuse must be strictly longer than the known leg, otherwise no real triangle exists and a guard message appears.
  • Answers are rounded to four decimal places, so irrational results like the square root of 2 are shown as approximations.

Common mistakes

  • Treating the longest given side as a leg when finding a missing leg; the hypotenuse must be the value you subtract from.
  • Adding the sides instead of their squares; 3 plus 4 is 7, but the hypotenuse of a 3 by 4 right triangle is 5, not 7.

Frequently asked questions

What is the Pythagorean theorem?

In any right-angled triangle, the square of the hypotenuse (the longest side, opposite the right angle) equals the sum of the squares of the other two sides. Written as a formula, that is a squared plus b squared equals c squared.

How do you find the hypotenuse?

Square both legs, add them, then take the square root. For legs of 3 and 4, you get 9 plus 16, which is 25, and the square root of 25 is 5, so the hypotenuse is 5.

How do you find a missing leg?

Subtract the square of the known leg from the square of the hypotenuse, then take the square root. The hypotenuse must be longer than the known leg, otherwise the triangle cannot exist. For a hypotenuse of 13 and a leg of 5, the other leg is the square root of 144, which is 12.

What is 3 squared plus 4 squared?

25. 3 squared is 9 and 4 squared is 16, and 9 plus 16 is 25. The square root of 25 is 5, which is why a right triangle with legs of 3 and 4 has a hypotenuse of exactly 5. It is the smallest right triangle whose three sides are all whole numbers.

Is a squared plus b squared the same as (a + b) squared?

No. (a + b) squared expands to a squared plus 2ab plus b squared, so it is always bigger by 2ab. For 3 and 4, a squared plus b squared is 25 but (3 + 4) squared is 49. Adding the legs first and then squaring is the most common slip when using the theorem by hand.

Does a squared plus b squared equal c squared in every triangle?

Only when the angle between a and b is exactly 90 degrees. For any other triangle the general rule is the law of cosines, c squared equals a squared plus b squared minus 2ab times the cosine of the angle C. At 90 degrees the cosine is 0, the last term drops out and you are left with the Pythagorean theorem.

What is a Pythagorean triple?

Three whole numbers that satisfy a squared plus b squared equals c squared, such as 3, 4, 5 or 5, 12, 13. Any multiple of a triple is also a triple, so 6, 8, 10 and 30, 40, 50 work too. Most pairs of whole-number legs do not give a whole-number hypotenuse: legs of 1 and 1 give the square root of 2, about 1.4142.

See all education calculators.