Geometry and statistics
Pythagorean theorem calculator
Pick the side you want to find, enter the other two, and the calculator works out the missing side of the right triangle. It also gives the area, the perimeter and the two acute angles.
Press Calculate. The answer and every step of the working will show here.
How it works
In a right triangle, one angle is exactly 90 degrees. The two sides that meet at that angle are the legs, a and b. The side opposite the right angle is the hypotenuse, c, and it is always the longest side. The Pythagorean theorem says that the squares built on the two legs add up to the square built on the hypotenuse: a² + b² = c².
To find the hypotenuse, square both legs, add them, and take the square root. To find a missing leg, rearrange the equation: subtract the square of the known leg from the square of the hypotenuse, then take the square root. That is why the calculator asks for c to be longer than the leg you give it. A leg longer than the hypotenuse would need a negative number under the root.
Once all three sides are known, the rest follows. The area of a right triangle is half the product of the legs. The perimeter is the sum of the three sides. The two acute angles come from the tangent: one angle is the inverse tangent of a divided by b, and the other is 90 degrees minus that.
If all three sides come out as whole numbers, such as 3, 4, 5 or 5, 12, 13, the calculator points out that you have a Pythagorean triple.
The formula
- Theorem: a² + b² = c²
- Hypotenuse: c = √(a² + b²)
- Missing leg: a = √(c² - b²) or b = √(c² - a²)
- Area = ½ × a × b. Perimeter = a + b + c
Worked example
A ladder leans against a wall. The foot is 6 feet from the wall and the ladder is 10 feet long. How high does it reach? The ladder is the hypotenuse, c = 10, and the distance on the ground is a leg, b = 6. Then a² = c² - b² = 100 - 36 = 64, and a = √64 = 8 feet. The triangle has area ½ × 6 × 8 = 24 square feet, and this is a scaled-up 3-4-5 triangle.
More examples
Finding the hypotenuse. Legs of 3 and 4: 9 + 16 = 25, and √25 = 5. The area is 6, the perimeter is 12, and the acute angles are about 36.87 and 53.13 degrees.
Finding a leg. Hypotenuse 13 and leg 5: b² = 169 - 25 = 144, so b = 12. The area is 30, the perimeter is 30, and the angles are about 22.62 and 67.38 degrees.
An answer that is not whole. Both legs equal to 1: c² = 1 + 1 = 2, so c = √2 = 1.4142 (rounded). The calculator also gives an area of 0.5, a perimeter of 3.4142 and two 45-degree angles.
A diagonal. A rectangular screen is 16 inches wide and 12 inches tall. The diagonal is the hypotenuse: 256 + 144 = 400, and √400 = 20 inches.
Common mistakes
- Adding when you should subtract. To find a leg, subtract: c² - b². Adding would give a hypotenuse bigger than c.
- Forgetting the square root. a² + b² = 25 gives c² = 25, not c = 25. The last step is always the root.
- Calling the wrong side the hypotenuse. It is the side opposite the right angle, not just the side that is drawn at the bottom or the side labeled c in a diagram.
- Using the theorem on a triangle with no right angle. It only works if one angle is exactly 90 degrees.
When to use it
The theorem is used wherever a right angle shows up: checking that a corner of a deck or a room is square, working out how long a ramp or ladder must be, and finding the straight-line distance between two points on a map or a coordinate grid.
It is also the base of the distance formula in coordinate geometry and a first step to trigonometry. Students use the calculator to check homework, and builders use the 3-4-5 rule: measure 3 along one wall and 4 along the other, and if the diagonal is exactly 5, the corner is square.
Common questions
What is a Pythagorean triple?
Three whole numbers that satisfy a² + b² = c². The best known are 3, 4, 5, then 5, 12, 13, then 8, 15, 17, and 7, 24, 25. Any multiple of a triple, such as 6, 8, 10, is also a triple.
Does it work for any triangle?
No, only right triangles. For other triangles you need the law of cosines, which reduces to the Pythagorean theorem when the angle is 90 degrees.
How do I know which side is the hypotenuse?
It is the side across from the right angle, and always the longest of the three. If you are not sure, find the right angle (often marked with a small square) and look at the side that does not touch it.
Why does the calculator give angles?
Once the sides are known, the angles are fixed. They come from the tangent ratio, and they always add up to 90 degrees, since the third angle is the right angle and the three together make 180.
Can I use it for a 3D diagonal?
Yes, in two steps. Find the diagonal of the base first, then use that as one leg with the height as the other. A box 3 by 4 by 12 has a base diagonal of 5, and a space diagonal of 13.
What units should I use?
Any, as long as all sides use the same one. The area comes out in square units and the perimeter in plain units of the same type.
You might also need
- Area CalculatorArea and perimeter of a rectangle, triangle, circle, trapezoid or parallelogram.
- Circle CalculatorStart from the radius, diameter, circumference or area and find all the rest.
- Exponent CalculatorRaise a number to a power, including negative and fractional exponents, with the laws of exponents.
Need a quick calculation instead? The free scientific calculator on the homepage handles roots, powers, trig and logs, and the math guides explain each method step by step.