In a right-angled triangle the square of the longest side (the hypotenuse) equals the sum of the squares of the other two. It lets you find any missing side when you know the other two.
Each part of this topic has its own page with the formula, worked examples and a solver: Pythagoras in 3D, Pythagoras' theorem, Hypotenuse from the two shorter sides, Shorter side from the hypotenuse.
In a right-angled triangle the square on the hypotenuse equals the sum of the squares on the other two sides. It finds a missing side whenever two are known.
Finding the length of a diagonal or a straight-line distance.
Checking that a corner is a right angle.
Working out heights and slopes in practical problems.
How to solve it
Identify the hypotenuse: the side opposite the right angle, and always the longest.
To find the hypotenuse, add the squares of the other two sides and take the square root.
To find a shorter side, subtract the square of the known short side from the square of the hypotenuse, then take the square root.
Round only at the end, and give the units.
Sense check: the hypotenuse must be longer than either of the other sides.
Worked examples
The examples marked with a button were worked out by the solver on this page. You can try each one yourself.
Example 1: right triangle a=3 b=4
Worked out by the solver on this page. Press the button to try it yourself.
PythagorasAnswer checked
Answer
c=5
Label the two shorter sides and the hypotenuse
a=3,b=4,c=?
Use Pythagoras: a2+b2=c2
32+42=c2
Work out the squares and add
9+16=25
Take the square root
c=25=5
Check: the hypotenuse is the longest side
5>4 and 32+42=25=c2
Example 2: right triangle a=5 b=12
Worked out by the solver on this page. Press the button to try it yourself.
PythagorasAnswer checked
Answer
c=13
Label the two shorter sides and the hypotenuse
a=5,b=12,c=?
Use Pythagoras: a2+b2=c2
52+122=c2
Work out the squares and add
25+144=169
Take the square root
c=169=13
Check: the hypotenuse is the longest side
13>12 and 52+122=169=c2
Example 3: right triangle c=13 a=5
Worked out by the solver on this page. Press the button to try it yourself.
PythagorasAnswer checked
Answer
x=12
Label the sides: the hypotenuse is the longest side, opposite the right angle
c=13,a=5,b=x
Use Pythagoras: a2+b2=c2
52+x2=132
Rearrange to find x2
x2=132−52=169−25=144
Take the square root
x=144=12
Check: the squares add up
52+122=169=132=169
Example 4: right triangle a=7 b=9
Worked out by the solver on this page. Press the button to try it yourself.
PythagorasAnswer checked
Answer
c=130
≈11.40
Label the two shorter sides and the hypotenuse
a=7,b=9,c=?
Use Pythagoras: a2+b2=c2
72+92=c2
Work out the squares and add
49+81=130
Take the square root
c=130=130
Check: the hypotenuse is the longest side
130>9 and 72+92=130=c2
Special cases
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
Hypotenuse
a = 3, b = 4: c = 5
Add the squares, then root.
A shorter side
c = 13, a = 5: b = 12
Subtract the squares.
Not a whole number
a = 7, b = 9: c ≈ 11.40
Round at the end.
3D diagonal
a cuboid 2 × 3 × 6: 7
Add three squares.
Word problems
Square the known sides, add to find the hypotenuse or subtract to find a shorter side, then take the square root.
Hypotenuse
Find c when a = 3, b = 4.
Add the squares9 + 16 = 25
Rootc = 5
Check: 3² + 4² = 5² ✓5
A shorter side
Find b when c = 13, a = 5.
Subtract169 − 25 = 144
Rootb = 12
Check: 25 + 144 = 169 ✓12
A decimal answer Higher
Find c when a = 7, b = 9.
Add the squares49 + 81 = 130
Root11.40
Check: 11.4² ≈ 130 ✓11.4
A space diagonal Higher
Find the diagonal of a 2 × 3 × 6 cuboid.
Add three squares4 + 9 + 36 = 49
Root7
Check: 7² = 49 ✓7
Common mistakes
Adding when finding a shorter side
b² = 13² + 5² ✗
b² = 13² − 5² ✓
The hypotenuse is the largest.
Forgetting the square root
c = 25 ✗
c = 5 ✓
You find c².
Using the theorem on a triangle with no right angle