Pythagorean Theorem Calculator
Compute the hypotenuse of a right triangle from its two legs using the Pythagorean theorem (c = sqrt(a^2 + b^2)), and get the triangle's area.
- Triangle area
- 6 units²
- Perimeter
- 12 units
Enter the two legs (a and b) of a right triangle. The hypotenuse is the longest side, opposite the right angle.
What the Pythagorean Theorem Calculator Does
This calculator finds the hypotenuse of a right triangle when you know the lengths of its two shorter sides (the legs). Enter the two leg lengths, and it returns the length of the longest side, which always sits opposite the 90-degree angle.
It is useful for students checking geometry homework, carpenters and DIYers squaring up a deck or wall, surveyors estimating diagonal distances, and anyone who needs a fast, accurate hypotenuse without working through square roots by hand. The Pythagorean theorem applies only to right triangles, so make sure the angle between your two legs is exactly 90 degrees before relying on the result.
How It Works: The Pythagorean Theorem Formula
The theorem states that the square of the hypotenuse equals the sum of the squares of the two legs. Written out with a and b as the legs and c as the hypotenuse:
c = sqrt(a^2 + b^2)
This comes from rearranging the classic form a^2 + b^2 = c^2. The same relationship can be flipped to find a missing leg instead of the hypotenuse: a = sqrt(c^2 - b^2). Whichever side is unknown, you square the two sides you know, add or subtract as needed, then take the square root.
Worked Example With Real Numbers
Suppose a right triangle has legs of a = 3 and b = 4. Square each leg: 3^2 = 9 and 4^2 = 16. Add them: 9 + 16 = 25. Take the square root: sqrt(25) = 5. So the hypotenuse c = 5. This is the well-known 3-4-5 right triangle.
For a less tidy case, take legs of a = 6 m and b = 8 m. Then 6^2 + 8^2 = 36 + 64 = 100, and sqrt(100) = 10 m. With a = 5 and b = 7, you get 25 + 49 = 74, and sqrt(74) is about 8.60 (rounded to two decimals).
Tips, Common Mistakes, and Factors That Affect the Result
A few practical points keep your answers correct and meaningful:
- Use the same unit for both legs. Mixing meters and centimeters, or inches and feet, gives a wrong hypotenuse. Convert first.
- The theorem only works for right triangles. If the angle between the legs is not 90 degrees, use the Law of Cosines instead.
- Square before you add. A frequent error is adding the legs first and then squaring; (a + b)^2 is not the same as a^2 + b^2.
- The hypotenuse is always the longest side. If your result is shorter than one of the legs, recheck your inputs.
- Many results are irrational. Values like sqrt(74) never end as exact decimals, so the calculator rounds. Carry extra digits for construction or engineering work.
A Quick Real-World Use: Squaring a Corner
Builders use the theorem to check whether a corner is truly square. Measure 3 units along one wall and 4 units along the other; if the diagonal between those marks is exactly 5 units, the corner is 90 degrees. Scaling up to 6-8-10 or 9-12-15 makes the check more precise over longer runs.
The same idea gives straight-line distance. If a point is 30 feet east and 40 feet north, the direct diagonal distance is sqrt(30^2 + 40^2) = sqrt(2500) = 50 feet.
Frequently asked questions
What is the Pythagorean theorem?
For a right triangle, the square of the hypotenuse (c) equals the sum of the squares of the two legs: a² + b² = c². So c = sqrt(a² + b²).
Which side is the hypotenuse?
The hypotenuse is the longest side of a right triangle and is always opposite the 90° angle. The two shorter sides that form the right angle are the legs, a and b.
How is the triangle's area calculated?
Because the two legs are perpendicular, the area of a right triangle is simply half the product of its legs: area = (a × b) / 2.
Can I find a leg if I know the hypotenuse?
Yes. Rearranging the theorem, a = sqrt(c² − b²). This calculator takes the two legs as inputs, but you can solve for a missing leg with that formula.