Pythagorean Theorem Calculator
Free Pythagorean theorem calculator. Find the hypotenuse or either leg of a right triangle. See formula work and visual proof.
What the Pythagorean theorem solves
In any right-angled triangle, the square of the longest side equals the sum of the squares of the other two: a² + b² = c², where c is the hypotenuse, opposite the right angle. Given any two sides, this calculator finds the third, shows the formula it used, and draws the triangle to scale. It is the same relationship used to check a corner is square on a building site and to find the diagonal of a screen or a field.
How the calculator works
- Find the hypotenuse: c = √(a² + b²).
- Find a leg: a = √(c² − b²), and symmetrically for b.
- The side you are solving for is disabled in the input, so you cannot accidentally overwrite it.
- If you enter a leg longer than the hypotenuse, the tool refuses the calculation and tells you the hypotenuse must be the longest side — a right triangle cannot exist otherwise.
- It also reports the triangle’s area (a × b ÷ 2) and rounds results cleanly, so 3-4-5 comes out as exactly 5, not 4.9999.
Worked examples
| Given | Calculation | Result |
|---|---|---|
| a = 3, b = 4 | c = √(9 + 16) = √25 | c = 5, area = 6 |
| a = 5, c = 13 | b = √(169 − 25) = √144 | b = 12, area = 30 |
| a = 8, b = 15 | c = √(64 + 225) = √289 | c = 17, area = 60 |
Common Pythagorean triples
Whole-number triples like these turn up constantly in tests and in practice, because the square roots resolve to integers.
| a | b | c (hypotenuse) |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 8 | 15 | 17 |
| 7 | 24 | 25 |
| 20 | 21 | 29 |
Any multiple of a triple is also a triple: 6-8-10 is 3-4-5 doubled, 15-36-39 is 5-12-13 tripled, and so on.
Common mistakes
- Using it on a triangle that is not right-angled. The relationship only holds with a 90-degree angle. Other triangles need the law of cosines.
- Mixing up the hypotenuse. c is always the side opposite the right angle, and always the longest. If your two legs add up longer than c, the inputs are wrong.
- Mixing units. Both legs must be in the same unit before squaring. Feet and inches together produce nonsense unless converted first.
- Forgetting the square root. a² + b² gives the square of the hypotenuse, not the side itself.
- Assuming the answer is a whole number. Most results are irrational decimals; only the common triples resolve into integers.
Frequently asked questions
What if I only know one side?
You need two. The theorem has three unknowns and one equation, so a single side is not enough — you also need either a second side or an angle, and the angle case needs trigonometry instead.
Can a right triangle have two equal legs?
Yes — that is an isosceles right triangle, with legs of equal length and a hypotenuse of a√2. If each leg is 10, the hypotenuse is about 14.142.
How is this used in construction?
The 3-4-5 triple is the classic way to square a corner: measure 3 along one edge and 4 along the other, and if the diagonal between those points is 5, the corner is a true right angle. It scales up to 6-8-10 or larger for bigger spaces. The same geometry underpins roof geometry, where the roof pitch calculator uses rise and run to find slope and surface area.
Does the theorem work in three dimensions?
Yes, extended: the diagonal of a box is √(l² + w² + h²). The two-dimensional version is just the first step of that calculation.
Right triangles sit inside a lot of the other tools here — from roof pitch and stair layout to anything where a diagonal distance matters. Once a² + b² = c² is second nature, those problems become a single calculation.