How this Pythagorean theorem calculator works
A right triangle has one 90° angle. The two sides that meet at that corner are the legs, written a and b, and the longest side — the one opposite the right angle — is the hypotenuse, written c. The Pythagorean theorem ties them together: a² + b² = c².
Because you have one equation in three sides, knowing any two sides fixes the third. If you enter both legs, the tool computes the hypotenuse as c = √(a² + b²). If you enter a leg and the hypotenuse, it rearranges the formula to find the missing leg as a = √(c² − b²) — and checks that the hypotenuse really is longer than the known leg, since otherwise no such triangle exists.
Once all three sides are known, the rest follows. The two acute angles come from trigonometry: the angle opposite leg a is atan(a / b) (equivalently asin(a / c)), and the two acute angles always sum to 90°. The legs are perpendicular, so they double as base and height, giving an area of ½ · a · b, and the perimeter is a + b + c.
Some side lengths come out as whole numbers on all three sides. These are called Pythagorean triples, and they are handy for laying out or checking right angles without a protractor.
| Triple (a-b-c) | Leg a | Leg b | Hypotenuse c | Check a² + b² |
|---|---|---|---|---|
| 3-4-5 | 3 | 4 | 5 | 9 + 16 = 25 |
| 5-12-13 | 5 | 12 | 13 | 25 + 144 = 169 |
| 8-15-17 | 8 | 15 | 17 | 64 + 225 = 289 |
| 7-24-25 | 7 | 24 | 25 | 49 + 576 = 625 |
Reference note: angles are shown in degrees and rounded for display. The Pythagorean theorem and these formulas apply only to right triangles — triangles with a 90° angle.
Frequently asked questions
- What is the Pythagorean theorem?
- It states that in a right triangle the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c², where c is the side opposite the right angle and a and b are the two legs that meet at the right angle.
- How do I find the hypotenuse?
- When you know both legs, the hypotenuse is the square root of the sum of their squares: c = √(a² + b²). For example, legs of 3 and 4 give a hypotenuse of √25 = 5.
- How do I find a leg?
- If you know one leg and the hypotenuse, rearrange the formula: a = √(c² − b²). The hypotenuse c must be longer than the known leg, otherwise no right triangle exists.
- What is a Pythagorean triple?
- A set of three whole numbers a, b and c that satisfy a² + b² = c², such as 3-4-5, 5-12-13 and 8-15-17. They form right triangles with all-integer sides and are handy for checking right angles.
- Does it only work for right triangles?
- Yes. The theorem a² + b² = c² holds only for right triangles — those containing a 90° angle. For other triangles you need the law of cosines instead.
- How do I find the angles?
- One angle is always 90°. For the acute angle opposite leg a, use atan(a / b) or asin(a / c). The two acute angles always add up to 90°.