What is the Pythagorean theorem?
For any right triangle (a triangle with one 90° angle), the Pythagorean theorem says:
a² + b² = c²
where a and b are the two legs (the sides forming the right angle), and c is the hypotenuse (the side opposite the right angle).
The hypotenuse is always the longest side of a right triangle. The theorem lets you find any side from the other two: square them, add or subtract, take the square root.
For a triangle with legs 3 and 4: c² = 3² + 4² = 9 + 16 = 25, so c = 5. This is the famous 3-4-5 right triangle, the simplest "Pythagorean triple" — three positive integers where the relationship holds exactly.
How to use the calculator
Two modes:
- Find c (hypotenuse) — enter the two legs (a and b); the calculator returns c = √(a² + b²).
- Find leg — enter one leg and the hypotenuse; the calculator returns the other leg = √(c² − a²).
The result updates as you type. The formula appears below the answer with your values plugged in, so you can verify the math by hand. Click any of the listed Pythagorean triples to load them into the calculator.
The famous Pythagorean triples
Pythagorean triples are sets of three positive integers (a, b, c) where a² + b² = c². There are infinitely many — Euclid proved this 2,300 years ago — but a handful keep showing up in geometry problems and real-world contexts.
| Triple | a² | b² | c² | Note |
|---|---|---|---|---|
| 3, 4, 5 | 9 | 16 | 25 | The classic — smallest and most famous |
| 5, 12, 13 | 25 | 144 | 169 | Second-smallest primitive |
| 8, 15, 17 | 64 | 225 | 289 | Third primitive |
| 7, 24, 25 | 49 | 576 | 625 | "Almost-isoceles" — 24 and 25 are nearly equal |
| 20, 21, 29 | 400 | 441 | 841 | 20 and 21 are consecutive integers — rare property |
| 9, 40, 41 | 81 | 1,600 | 1,681 | Used in 12th-century geometry texts |
Plus all integer multiples: 6-8-10 = 2 × 3-4-5; 9-12-15 = 3 × 3-4-5; 10-24-26 = 2 × 5-12-13. Memorizing the primitives lets you spot triples mentally — a 12-foot wall, an 8-foot lean (so 12-8-? = ?), you can guess it's a 4-3-5 multiple and the answer is 4√(9+16) = 4×5 = … wait, that's wrong. 8² + b² = 12² means b = √(144−64) = √80 ≈ 8.94. Not a triple. The mental math works only when the actual numbers fit a triple's ratio.
Where it's useful
Construction. Carpenters use the 3-4-5 triple to verify a corner is square (90°). Mark 3 ft along one wall, 4 ft along the perpendicular wall, then measure the diagonal — if it's exactly 5 ft, the corner is square. The famous "3-4-5 method" is how foundations get squared without a precision tool.
Navigation and travel distance. If you walk 4 km north then 3 km east, you've gone 5 km in a straight line from your starting point — by Pythagoras, even though you walked 7 km total along your path. Useful for estimating "as the crow flies" distance.
Computer graphics and game development. Distance between two points on a screen, angles between vectors, collision detection for circular objects — all use Pythagoras (often via the related distance formula).
TV and monitor sizing. A "27-inch monitor" measures the diagonal — which is the hypotenuse of a right triangle with width and height as legs. So a 27-inch 16:9 monitor has width × height of about 23.5 × 13.2 inches (since √(23.5² + 13.2²) ≈ 27).
Vector physics. Decomposing forces into perpendicular components, finding the magnitude of velocity from x and y components — Pythagoras everywhere.
Common student mistakes
Three errors students make repeatedly:
1. Squaring then forgetting the square root. The theorem says c² = a² + b². The actual hypotenuse is c, not c². So a² + b² gives you the squared hypotenuse — you still need to take the square root. For 3 and 4: 9 + 16 = 25, hypotenuse = √25 = 5 (NOT 25).
2. Adding without squaring first. a + b = c is wrong (would only work if either leg were zero). The squaring is essential — that's where the geometry of right triangles enters the math.
3. Mixing up the hypotenuse. The hypotenuse is always opposite the right angle, and it's always the longest side. If your "answer" for c is shorter than one of the legs, you've solved for the wrong side. Use the find-leg mode instead.
Beyond the basic theorem
Distance formula: Pythagoras applied to coordinates. d = √((x₂−x₁)² + (y₂−y₁)²). The Distance Formula Calculator handles this directly.
Law of Cosines: generalization for non-right triangles. c² = a² + b² − 2ab·cos(C). When C = 90°, cos(C) = 0 and we collapse back to a² + b² = c².
3D extension: for three perpendicular dimensions, d = √(a² + b² + c²). The diagonal of a rectangular box, or the magnitude of a 3D vector. Same idea, one more squared term.
n-dimensional generalization: for any number of perpendicular dimensions, d = √(Σᵢ xᵢ²). In machine learning, this is called Euclidean distance and underlies many algorithms.
Related calculators
- For straight-line distance between two points (Pythagoras applied to coordinates), use the Distance Formula Calculator.
- For circle math (also π-based geometry), the Circumference Calculator.
- For 3D volume calculations, the Volume of a Cylinder Calculator.
- For aspect-ratio math (computing diagonal from width and height — direct application of Pythagoras for screens), the Aspect Ratio Calculator.
Frequently asked questions
What is the Pythagorean theorem?
For any right triangle (one with a 90° angle): a² + b² = c², where a and b are the two legs and c is the hypotenuse (the side opposite the right angle, always the longest).
How do I find the hypotenuse?
Square each leg, add them, take the square root. So c = √(a² + b²). For legs 3 and 4: c = √(9+16) = √25 = 5. The 3-4-5 right triangle is the most famous example.
How do I find a missing leg?
Rearrange to b = √(c² − a²). If you know the hypotenuse and one leg, square both, subtract the leg² from the hypotenuse², take the square root. For c = 5 and a = 3: b = √(25−9) = √16 = 4.
What's a Pythagorean triple?
Three positive integers (a, b, c) where a² + b² = c². The smallest are 3-4-5, 5-12-13, 8-15-17, 7-24-25, 20-21-29, 9-40-41. All multiples of these are also triples (6-8-10, 9-12-15, etc.). There are infinitely many primitive triples — Euclid proved this.
Does the theorem work for any triangle?
Only right triangles (one angle exactly 90°). For other triangles, use the Law of Cosines: c² = a² + b² − 2ab·cos(C). When C = 90°, the cos term zeros out and you get back the Pythagorean theorem.
Why is the longest side always the hypotenuse?
Because the hypotenuse is opposite the largest angle (90°), and in any triangle the side opposite a larger angle is longer than sides opposite smaller angles. The right angle is the largest by definition (the other two must each be less than 90° since they have to sum to 90° together), so its opposite side — the hypotenuse — is longest.
Is my input saved or sent anywhere?
No. The calculation runs entirely in your browser using JavaScript — nothing is sent to a server, logged, or stored.