Math
Pythagorean Theorem Calculator
Enter the two legs of a right triangle to find the hypotenuse, or enter the hypotenuse and one leg to find the other.
The link carries your figures, so it reopens on exactly these numbers.
The formula
c = √(a² + b²)
a = √(c² − b²)
b = √(c² − a²)
Worked example
The 3-4-5 triangle
- c = √(3² + 4²) = √(9 + 16) = √25 = 5
- 3² + 4² = 9 + 16 = 25 = 5² ✓
Where this goes wrong
Using the formula on a triangle that is not a right triangle
a² + b² = c² only holds when c is the hypotenuse of a right triangle. Applied to any other triangle, the formula gives a number that is not a side of that triangle. If you are not sure the angle is 90°, the law of cosines — c² = a² + b² − 2ab cos(C) — is the general version.
Questions
- How do I know which side is the hypotenuse?
- The hypotenuse is always the side opposite the right angle, and it is always the longest side. If you are measuring a rectangle's diagonal, that diagonal is the hypotenuse of the two right triangles it creates.
- Can the sides be decimals?
- Yes. The theorem works for any positive real lengths. 3-4-5 is a Pythagorean triple because all three happen to be integers, but √2 and √3 are just as valid.
- What are Pythagorean triples?
- Sets of three positive integers where a² + b² = c². The most common are 3-4-5, 5-12-13, 8-15-17, and 7-24-25. Every multiple of a triple is also a triple: 6-8-10, 9-12-15, and so on.