If you know two sides of a right triangle, you can find the third side in seconds. This Pythagorean theorem calculator does that work for you. Enter the two sides you know, choose what you want to find, and it returns the missing side along with the area, perimeter, and the two acute angles.
Students use it to check homework, and builders use it to check corners and diagonals for ramps, ladders, screens, and roof layouts. The math is simple, but square roots by hand are slow and easy to get wrong. This tool keeps the steps clear. You can find more tools like this in our Math Calculators hub.
Pythagorean Theorem Calculator
For a right triangle, a² + b² = c². Choose what to find, enter the two known sides, and get the missing side, area, perimeter, and angles.
Results
Note: This calculator only works for right-angled triangles. The hypotenuse c is always the longest side, opposite the 90° angle.
What Is the Pythagorean Theorem Calculator?
This is a free online tool for right-angled triangles. A right-angled triangle has one angle of exactly 90 degrees, called a right angle. The side opposite that angle is the longest side, called the hypotenuse. The other two sides, which form the right angle, are called legs.
The calculator takes any two known sides and finds the third. It also works out the area, the perimeter, and the two smaller angles, so you get a complete picture in one go. For plotting the triangle visually, you can also try our Desmos graphing calculator alongside this tool.
How It Works and the Formula
The theorem, named after Pythagoras, states that in a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs:
a² + b² = c²
Here, a and b are the legs, and c is the hypotenuse. A right angle is a 90-degree corner, like the corner of a sheet of paper. Only the side opposite that corner can be c, and c is always the longest side.
To find the hypotenuse: c = √(a² + b²). To find a missing leg, rearrange the formula: a = √(c² − b²) and b = √(c² − a²). When you solve for a leg, you subtract, and the hypotenuse must be longer than the known leg, otherwise you would need the square root of a negative number.
Once all three sides are known, the area is ½ × a × b, the perimeter is a + b + c, and the acute angles use inverse tangent: angle A, opposite side a, is arctan(a ÷ b) in degrees, and angle B is arctan(b ÷ a). The two acute angles always add to 90°. If your side lengths are fractions, our fraction calculator can convert them to decimals first.
How to Use the Pythagorean Theorem Calculator
- Choose what you want to find: hypotenuse c, leg a, or leg b.
- Enter the first known side length, using the same unit for both sides, such as inches, centimetres, or metres.
- Enter the second known side length.
- Click Calculate. The tool checks that both values are positive and, when solving for a leg, that the hypotenuse is longer than the known leg.
- Read the results: the missing side, area, perimeter, and the two acute angles in degrees.
- Click Reset to clear the inputs and start a new problem.
Worked Example
Suppose a right triangle has legs a = 3 and b = 4. What is the hypotenuse?
Use a² + b² = c². Substitute: 3² + 4² = c². Work out the squares: 9 + 16 = 25, so c² = 25. Take the square root: c = √25 = 5.
Area = ½ × 3 × 4 = 6. Perimeter = 3 + 4 + 5 = 12. Angle A = arctan(3 ÷ 4) ≈ 36.87°. Angle B = arctan(4 ÷ 3) ≈ 53.13°. Check: 36.87° + 53.13° = 90°, as expected. This 3-4-5 triangle is famous because all three sides are whole numbers.
Common Pythagorean Triples
A Pythagorean triple is a set of three whole numbers that satisfy a² + b² = c² exactly, giving an answer with no rounding.
| Leg a | Leg b | Hypotenuse c |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 8 | 15 | 17 |
| 7 | 24 | 25 |
| 20 | 21 | 29 |
Multiples of a triple also work: doubling 3-4-5 gives 6-8-10, and tripling it gives 9-12-15. Builders use the 3-4-5 rule to check a square corner: measure 3 units along one edge and 4 along the other, and the diagonal should be exactly 5.
Important Points and Assumptions
The theorem only works for right-angled triangles. If there is no 90-degree angle, a² + b² = c² does not apply, and you would need a different rule such as the law of cosines. The calculator assumes c is the hypotenuse opposite the right angle, both inputs use the same unit, and side lengths are positive. A length of zero or a negative length has no meaning for a real triangle, so those are treated as errors. For square and root checks, our scientific calculator is a useful companion.
Common Mistakes
The most common mistake is putting a leg in the c position. The hypotenuse is always opposite the right angle and always the longest side; swapping it with a leg gives a wrong answer or an impossible subtraction. Another frequent error is forgetting the final square root: a² + b² gives c², not c.
Other mistakes include adding the legs directly (3 + 4 = 7 instead of √(9 + 16) = 5), mixing units such as inches and centimetres, rounding too early, and adding the squares when solving for a leg instead of subtracting them.
How to Interpret Your Results
The missing side is in the same unit you entered. The area is in square units, so an area of 6 with sides in centimetres means 6 square centimetres. The perimeter is the total distance around the triangle, in the same unit as the sides.
The angles are in degrees. The third angle is always 90°, so the two acute angles should add to 90°. Results are rounded sensibly, usually to four decimal places with trailing zeros removed. If your result feeds into a ratio problem, our percentage calculator can help with the next step.
Frequently Asked Questions
Does the Pythagorean theorem work for all triangles?
No. It only works for right-angled triangles with one 90-degree angle. Other triangles need rules such as the law of cosines or the law of sines.
Which side is the hypotenuse?
The side opposite the right angle. It is always the longest side and is labelled c in a² + b² = c².
Can the hypotenuse be shorter than a leg?
No. It is always the longest side. If you enter a hypotenuse shorter than or equal to a leg when solving for the other leg, the calculator shows an error because no such right triangle exists.
What if my sides are not whole numbers?
That is fine. The calculator accepts decimals such as 2.5 or 7.25. The missing side may also be a decimal and will be rounded for display.
How do I find a missing leg instead of the hypotenuse?
Choose “Find leg a” or “Find leg b,” then enter the known leg and the hypotenuse. The calculator subtracts the squares, for example a = √(c² − b²).
Why do the two acute angles add up to 90 degrees?
Angles in any triangle add to 180°. One angle here is 90°, so the other two must add to 180° − 90° = 90°. This is a helpful check on your results.
References
For more lessons and practice, see Khan Academy’s Pythagorean theorem lessons, which cover the theorem, its proofs, and real-world applications.