Pythagorean Theorem Calculator: a² + b² = c²
Choose what you want to find: the hypotenuse, a missing leg, or whether three sides form a right triangle. You get the answer with the working, the angles and the area.
Last reviewed
Hypotenuse c
5
c = √(3² + 4²) = √25
- Angles opposite the legs
- 36.86989765° and 53.13010235°
- Area
- 6
- Whole-number triple?
- yes
For a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs. The hypotenuse is the longest side, opposite the right angle.
The theorem
For a right triangle with legs a and b and hypotenuse c, the square of the hypotenuse equals the sum of the squares of the legs:
a² + b² = c²
This is the Pythagorean theorem, as stated by Wolfram MathWorld. The hypotenuse is the side opposite the right angle, and it is always the longest side. The theorem gives you any one side when you know the other two.
- Hypotenuse: c = √(a² + b²)
- A missing leg: b = √(c² − a²)
Worked examples
Legs 3 and 4. c = √(9 + 16) = √25 = 5. The angles opposite the legs are 36.8699° and 53.1301°, and the area is 3 × 4 ÷ 2 = 6.
Legs 1 and 1. c = √2 = 1.41421356237. The legs are equal, so the angles are both 45°.
Hypotenuse 13, leg 5. b = √(169 − 25) = √144 = 12.
Hypotenuse 10, leg 6. b = √(100 − 36) = √64 = 8.
Legs 7 and 9. c = √(49 + 81) = √130 = 11.401754251. This is not a whole number, so (7, 9, √130) is not a triple.
Pythagorean triples
A Pythagorean triple is a set of three whole numbers that satisfy a² + b² = c². Any multiple of a triple is also a triple.
| a | b | c | a² + b² | c² |
|---|---|---|---|---|
| 3 | 4 | 5 | 25 | 25 |
| 5 | 12 | 13 | 169 | 169 |
| 8 | 15 | 17 | 289 | 289 |
| 7 | 24 | 25 | 625 | 625 |
| 20 | 21 | 29 | 841 | 841 |
| 6 | 8 | 10 | 100 | 100 |
Is it a right triangle?
Give the calculator three sides and it sorts them, squares the two shorter ones and compares their sum with the square of the longest. This follows from the law of cosines, c² = a² + b² − 2ab cos C, where C is the angle opposite the longest side:
- If a² + b² equals c², cos C is 0 and the triangle is right.
- If it is greater, cos C is positive and the triangle is acute.
- If it is less, cos C is negative and the triangle is obtuse.
| Sides | a² + b² | c² | Triangle |
|---|---|---|---|
| 3, 4, 5 | 25 | 25 | right |
| 7, 8, 9 | 113 | 81 | acute |
| 2, 3, 4 | 13 | 16 | obtuse |
| 1, 2, 3 | 5 | 9 | not a triangle |
Three lengths only make a triangle if the longest is shorter than the other two added together. Sides 1, 2 and 3 fail that test, since 1 + 2 is not more than 3.
Where it is used
- Distance. The straight-line distance between two points is the hypotenuse of a right triangle whose legs are the horizontal and vertical differences.
- Diagonals. The diagonal of a rectangle that is 6 by 8 is 10.
- Squaring a corner. A builder checks a corner is square with a 3-4-5 triangle, scaled up.
- Ladders and ramps. The length of a ladder against a wall comes from the height and the distance from the wall.
Common mistakes
- Using the theorem on a triangle with no right angle. It only holds for right triangles.
- Adding the sides instead of their squares. 3 + 4 is not 5.
- Forgetting the square root. a² + b² is c², not c.
- Treating a leg as the hypotenuse. The hypotenuse is the longest side.
- Mixing units. All sides must be in the same unit.
For a right triangle with an angle, use the right triangle calculator. To find the distance between two points, use the distance calculator, and for square roots the root calculator.
How it is calculated
Squares, sums and roots are exact decimal arithmetic to 50 digits, and results are shown to 12 significant figures, with the angles to 10. A set is called a triple only if all three sides are whole numbers.
Frequently asked questions
What is the Pythagorean theorem?
In a right triangle with legs a and b and hypotenuse c, a² + b² = c². The hypotenuse is the side opposite the right angle, and it is always the longest.
How do I find a missing leg?
Rearrange to b = √(c² − a²). For a hypotenuse of 13 and a leg of 5, b = √(169 − 25) = √144 = 12.
What is a Pythagorean triple?
Three whole numbers that satisfy a² + b² = c², such as 3, 4, 5 or 5, 12, 13 or 8, 15, 17. Any multiple of a triple is another triple, so 6, 8, 10 also works.
How can I tell if three sides make a right triangle?
Square the two shorter sides and add them. If the total equals the square of the longest side, the triangle is right-angled. If it is more the triangle is acute, and if it is less it is obtuse.
Why does the check use the law of cosines?
The law of cosines says c² = a² + b² − 2ab cos C. The angle C opposite the longest side is a right angle when cos C is 0, acute when it is positive and obtuse when it is negative, which gives exactly the comparison above.
Do any three numbers make a triangle?
No. The longest side must be shorter than the other two added together. Sides of 1, 2 and 3 lie flat in a straight line, and 1, 2 and 4 cannot meet at all, so the calculator reports that they are not a triangle.
Related calculators
- Right Triangle CalculatorChoose what you know about the right triangle and enter it.
- Distance CalculatorChoose what you are measuring between.
- Root CalculatorEnter a number and a root index.
- Exponent CalculatorEnter a base and an exponent.
- Quadratic Formula CalculatorEnter a, b and c to solve a quadratic equation.
- Slope CalculatorEnter two points.