Pythagorean theorem calculator
The Pythagorean theorem says that in a right triangle a² + b² = c², where c is the hypotenuse. Choose which side to find, enter the two you know, and this Pythagorean theorem calculator solves for the third and shows the squares. It also gives the area, perimeter and angles, and can test any three lengths to see whether they make a right triangle.
Show the working, step by step
Write the theorem and put in both legs.
a² + b² = c² 5² = 25, 8² = 64 c² = 25 + 64 = 89
Take the positive square root of both sides.
c = √89 ≈ 9.433981
Area and perimeter of the right triangle.
Area = a × b ÷ 2 = 5 × 8 ÷ 2 = 20 Perimeter = a + b + c = 22.433981
Decimals are rounded to 6 significant figures. Only the positive root is used, because a length cannot be negative.
The formulas
a² + b² = c² c = √(a² + b²) a = √(c² − b²) b = √(c² − a²)
Sides a and b are the legs, which meet at the right angle, and c is the hypotenuse, the longest side. To find the hypotenuse you add the squares and take the root. To find a leg you subtract, so c must exceed the known leg. The calculator also gives the area, a × b ÷ 2, since the two legs are the base and height, and the acute angles, from the arctangent of a ÷ b.
Worked example: legs 5 and 8
- a² + b² = 25 + 64 = 89.
- c = √89 ≈ 9.433981. 89 is prime, so the radical cannot be simplified.
- Area = 5 × 8 ÷ 2 = 20, and the perimeter is 5 + 8 + 9.433981 = 22.433981.
Worked example: finding a leg, c = 13 and b = 5
- a² = c² − b² = 169 − 25 = 144.
- a = √144 = 12. The sides 5, 12, 13 are a Pythagorean triple.
Worked example: is 8, 15, 17 a right triangle?
The longest side is 17. 8² + 15² = 64 + 225 = 289 and 17² = 289, so the triangle is right-angled.
Pythagorean triples
A triple is three whole numbers that satisfy the theorem. A triple is primitive when the three numbers have no common factor; every other triple is a whole-number multiple of a primitive one.
| a, b, c | a² + b² | c² |
|---|---|---|
| 3, 4, 5 | 9 + 16 = 25 | 25 |
| 5, 12, 13 | 25 + 144 = 169 | 169 |
| 8, 15, 17 | 64 + 225 = 289 | 289 |
| 7, 24, 25 | 49 + 576 = 625 | 625 |
| 20, 21, 29 | 400 + 441 = 841 | 841 |
| 9, 40, 41 | 81 + 1600 = 1681 | 1681 |
Doubling 3-4-5 gives 6-8-10, and so on. Builders use 3-4-5 to square a corner: if the sides measure 3, 4 and 5 units, the corner is 90°.
Common mistakes
- Using a leg as c. The hypotenuse is always the longest side, opposite the right angle.
- Forgetting to take the square root at the end. 89 is c², not c.
- Adding when you should subtract. A missing leg is c² − b², never c² + b².
- Using the theorem on a triangle with no right angle. It holds only for right triangles. The triangle solver covers the general case.
- Mixing units. Convert both sides to the same unit first.
On a coordinate grid, the theorem becomes the distance formula; try the distance and midpoint calculator. If the answer is left as a radical, the square root calculator simplifies it.
Common questions
What is the Pythagorean theorem?
In a right triangle the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the other two sides: a² + b² = c². Given any two sides you can find the third. The converse also holds: if three side lengths satisfy a² + b² = c², the triangle has a right angle.
How do I find a missing leg with a squared plus b squared equals c squared?
Rearrange to a² = c² − b² and take the square root. With c = 13 and b = 5: a² = 169 − 25 = 144, so a = 12. The hypotenuse must be the longest side, so c has to be larger than b; the calculator rejects values where it is not.
How do I know if three sides make a right triangle?
Square the two shorter sides and add them, then compare with the square of the longest. Equal means right-angled (8² + 15² = 289 = 17²). A larger sum means all angles are acute, and a smaller sum means one angle is obtuse (5, 8, 10 gives 89 against 100). Choose “Is it a right triangle?” to run the test.
What is a Pythagorean triple?
Three positive whole numbers with a² + b² = c², such as 3-4-5, 5-12-13, 8-15-17, 7-24-25 and 20-21-29. Multiplying a triple by any whole number gives another, so 6-8-10 is a multiple of 3-4-5. The calculator marks a triple as primitive when its three numbers share no common factor.
Does the Pythagorean theorem work for any triangle?
Only for right triangles. For other triangles the law of cosines generalises it, c² = a² + b² − 2ab cos C, and reduces to the Pythagorean theorem when C = 90° because cos 90° = 0. The triangle solver handles those cases.
Related calculators
-
Triangle calculator
Area, angles, heights and radii of a triangle from any three parts.
-
Triangle solver
Solve any triangle with the sine and cosine rules.
-
Rectangle and square calculator
Diagonal, area and perimeter from length and width.
-
Distance and midpoint calculator
The distance formula, the theorem applied on a coordinate grid.
-
Area calculator
The area of thirteen common shapes.
-
Perimeter calculator
The distance round common shapes.
-
Square root calculator
Simplify the radical a missing side leaves you with.
-
Quadratic equation calculator
Solve equations where a squared term hides a side length.