The theorem — a² + b² = c²
In a right triangle, the square of the hypotenuse equals the sum of the squares of the legs. Only works when one angle is exactly 90°.
Call the two sides that form the right angle the legs (a and b), and the side opposite the right angle the hypotenuse (c). Then a² + b² = c². The hypotenuse is always the longest side.
Geometric proof sketch: draw a square with side (a+b). Inside, arrange four copies of the right triangle around a smaller square with side c. The total area (a+b)² equals 4·(½ab) + c², which simplifies to a² + b² = c².
Important: this only holds for right triangles. For any other triangle, use the law of cosines: c² = a² + b² − 2ab·cos(C), where C is the angle opposite side c. The Pythagorean theorem is the special case when C = 90° (cos 90° = 0).
- 3² + 4² = 9 + 16 = 25
- 5² = 25
- Yes — it satisfies a² + b² = c², so this is a right triangle.
a² + b² = c². The hypotenuse c is always opposite the 90° angle and always the longest side.
Solving for a missing side
Given any two sides, the theorem gives you the third. Just rearrange and take the square root.
Given both legs → find the hypotenuse: c = √(a² + b²).
Given the hypotenuse + one leg → find the other leg: a = √(c² − b²) (or b = √(c² − a²)). The hypotenuse must be the larger of the two known sides — otherwise c² − b² is negative and the equation has no real solution.
The calculator has a “Solve for” picker so you don't have to rearrange mentally.
- a² = c² − b²
- a² = 13² − 12² = 169 − 144 = 25
- a = √25 = 5
- Answer: a = 5
Any two sides give you the third. When solving for a leg, check that the hypotenuse is bigger first — otherwise the equation has no real answer.
Pythagorean triples — the integer shortcuts
Triples are sets of three positive integers that satisfy a² + b² = c² exactly. Spotting them saves arithmetic.
Primitive triples are the smallest integer solutions that aren't just scaled versions of a smaller triple. The first few:
• 3-4-5 — the most famous. Every 3-4-5 construction trick (carpenters squaring corners, soccer-field right angles) relies on it.
• 5-12-13
• 8-15-17
• 7-24-25
• 20-21-29
Any integer multiple of a primitive triple is also a triple: 6-8-10, 9-12-15, 10-24-26, 15-36-39. When you see 9-12-? in a problem, recognize it as 3·(3-4-5) and write 15 without computing.
Euclid's formula generates every primitive triple: for coprime m > n > 0 with one even, a = m² − n², b = 2mn, c = m² + n².
- a = m² − n² = 4 − 1 = 3
- b = 2mn = 4
- c = m² + n² = 5
- Result: 3-4-5 (the first primitive triple)
Learn 3-4-5 and 5-12-13 cold. Recognising a triple (or a scaled version) skips the arithmetic entirely.
Where the theorem shows up in real life
Not just geometry homework — the theorem underlies navigation, construction, physics, and screen sizing.
Straight-line distance between two points on a map (“as the crow flies”) is a Pythagorean problem. Distance = √((Δx)² + (Δy)²). The distance-formula calculator is literally a repackaged Pythagorean theorem.
Carpenters use the 3-4-5 rule to check square corners. Measure 3 units along one wall, 4 along the perpendicular wall, then the diagonal should be exactly 5. If it isn't, the corner isn't square.
Physics combines perpendicular vectors (e.g., horizontal velocity + vertical velocity) via the Pythagorean theorem to get the resultant magnitude.
Screen manufacturers quote the diagonal; the calculator lets you derive it from width and height. A 4K monitor at 3840 × 2160 pixels has a diagonal of √(3840² + 2160²) ≈ 4405 pixels.
Anywhere two perpendicular measurements combine into a resultant (distance, force, diagonal), the Pythagorean theorem is the right tool.
Four common mistakes
Most Pythagorean errors come from side-confusion or forgetting the final square root.
1. Mixing up legs and hypotenuse. The hypotenuse is always opposite the right angle and always longest. If the problem calls c a leg, re-read it.
2. Forgetting to square-root. a² + b² = c² gives you c-squared. Take √ to get c.
3. Applying it to non-right triangles. Check the problem actually marks a 90° angle. If not, use the law of cosines.
4. Sign errors when solving for a leg. a² = c² − b² requires c > b. If your hypotenuse is smaller than your known leg, the geometry is impossible.
Identify the hypotenuse first, remember to √ at the end, confirm the angle is 90°, and make sure c is bigger than any leg you know.
Frequently Asked Questions
Does the Pythagorean theorem work for any triangle?
▾
Does the Pythagorean theorem work for any triangle?
▾No — only for right triangles (one angle exactly 90°). For general triangles, use the law of cosines: c² = a² + b² − 2ab·cos(C). The Pythagorean theorem is the special case when C = 90° (cos 90° = 0).
Why does the calculator reject c < b when solving for a?
▾
Why does the calculator reject c < b when solving for a?
▾Because a² = c² − b² must be non-negative for a real solution. If c is smaller than b, you're trying to take the square root of a negative number — and geometrically, the hypotenuse can't be shorter than a leg. The calculator catches this and errors out.
What's the difference between a "primitive" triple and a scaled one?
▾
What's the difference between a "primitive" triple and a scaled one?
▾A primitive triple has no common factor — like 3-4-5 or 5-12-13. Scaled triples are integer multiples of primitives: 6-8-10 is 2 × (3-4-5), 15-20-25 is 5 × (3-4-5). Both are valid Pythagorean triples; primitives are the "base" set.
How accurate is the calculator for irrational results?
▾
How accurate is the calculator for irrational results?
▾Results are computed in double-precision floating point, which gives about 15-16 significant digits. For most Pythagorean problems that's effectively exact. The calculator shows 4-6 decimal places in the UI; the full precision is available in the PDF export.
What's the converse — can I tell if a triangle is right-angled from its sides?
▾
What's the converse — can I tell if a triangle is right-angled from its sides?
▾Yes. If a² + b² = c² for the longest side c, the triangle has a right angle opposite c. This is the converse of the Pythagorean theorem — the calculator's "Pythagorean triple" detection uses exactly this check.
Open the Pythagorean Theorem Calculator
Enter any two sides — see the missing side, triangle diagram, Pythagorean-triple detection, area, perimeter, and angles.
Open calculator