Pythagorean theorem calculator
For a right-angled triangle only. The theorem relates the squares of the sides, which is why the answer is rarely a round number even when the inputs are.
Result
- Hypotenuse
- 5
- Side a
- 3
- Side b
- 4
- Hypotenuse
- 5
- Area
- 6
- Perimeter
- 12
How this is calculated
The square on the hypotenuse equals the sum of the squares on the other two sides. The tool computes the hypotenuse with a method that avoids overflowing when a² alone would exceed the floating-point range, so very large sides still give a finite answer.
- a, b
- — the two legs, which meet at the right angle
- c
- — the hypotenuse, always the longest side
Worked example
Legs of 3 and 4 give a hypotenuse of √(9 + 16) = √25 = 5 — the classic right triangle, with an area of 6 and a perimeter of 12. Working backwards from a hypotenuse of 5 and a leg of 3 returns 4, as it must. Note that whole-number triples like 3-4-5 are the exception: legs of 1 and 1 give √2, which is irrational and has no exact decimal form.
How to use it
- Choose whether you are finding the hypotenuse or a leg.
- Enter the two sides you know. Units are whatever you type; the area comes out in their square.
- Check that the triangle really is right-angled — the theorem does not apply otherwise.
Limitations and assumptions
- Right-angled triangles only. For any other triangle use the law of cosines, or the triangle area calculator on this site.
- A leg must be shorter than the hypotenuse. Entering one that is equal or longer is refused, because no such right triangle exists.
- Most results are irrational and therefore rounded. The 3-4-5 and 5-12-13 style triples are special cases, not the norm.
- The theorem is flat-plane geometry. It does not hold on a sphere, which matters for long-distance navigation but not for a room.
Questions
How do I find the hypotenuse?
Square both legs, add them, then take the square root. For legs of 3 and 4: 9 + 16 = 25, and √25 = 5.
How do I check a corner is square?
Measure 3 units along one side and 4 along the other; the diagonal between those marks should be exactly 5. Any multiple works — 300 mm, 400 mm and 500 mm is the usual building-site version, and larger multiples give a more sensitive check.
Why is the answer usually not a whole number?
Because a sum of two squares is rarely a perfect square. Legs of 1 and 1 give √2 ≈ 1.414, which has no exact decimal. Pythagorean triples like 3-4-5 are the unusual cases where it works out neatly.
Related calculators
This page has not yet had an editorial review.
