Pythagorean Theorem Calculator
Find any side of a right triangle using the Pythagorean theorem: a² + b² = c². Solves for hypotenuse (c) or either leg (a or b).
Reviewed & updated for 2026 · How we calculate
Common Pythagorean triples
| a | b | c | Verification |
|---|---|---|---|
| 3 | 4 | 5 | 9 + 16 = 25 ✓ |
| 5 | 12 | 13 | 25 + 144 = 169 ✓ |
| 7 | 24 | 25 | 49 + 576 = 625 ✓ |
| 8 | 15 | 17 | 64 + 225 = 289 ✓ |
| 9 | 40 | 41 | 81 + 1600 = 1681 ✓ |
| 20 | 21 | 29 | 400 + 441 = 841 ✓ |
| 11 | 60 | 61 | 121 + 3600 = 3721 ✓ |
Why this 2,500-year-old theorem still matters everywhere
The Pythagorean theorem isn't just a school exercise, it's the foundation of nearly every distance and dimension calculation in modern engineering. GPS coordinates use it to compute distance between points. Computer graphics use it constantly to determine pixel distances, collision detection, and lighting calculations. Architecture and construction use it to ensure walls meet at right angles. Surveying uses it for property boundary calculations. Robotics, computer vision, and machine learning all use Euclidean distance, which is just a multi-dimensional Pythagorean calculation.
The theorem extends naturally to three dimensions. The diagonal of a rectangular box with sides a, b, c is √(a² + b² + c²). For a room 12 feet long, 10 feet wide, and 8 feet tall, the longest diagonal is √(144 + 100 + 64) = √308 = 17.5 feet, useful for fitting long objects through doorways or planning utility runs.
In n dimensions: distance = √(Δx₁² + Δx₂² + ... + Δxₙ²). This generalization, called Euclidean distance, is at the heart of clustering algorithms, recommendation systems, and high-dimensional data analysis. When Netflix suggests a movie, the algorithm is computing distances between users in a feature space with hundreds of dimensions, all using the same a² + b² = c² logic, just scaled up.
Real-world applications most people don't realize use Pythagoras
- Carpentry, squaring a foundation: The "3-4-5 method" is the contractor's way of ensuring perfect right angles. Mark 3 feet from a corner along one wall, 4 feet along the perpendicular wall. If the diagonal between those two marks is exactly 5 feet, the corner is a true 90°. Any multiple works: 6-8-10, 9-12-15. This trick has been used for thousands of years.
- Roof framing: Calculating rafter lengths from rise and run. A roof with 6 feet of rise over 12 feet of run has rafters √(6² + 12²) = √180 = 13.42 feet long. Critical for ordering correctly-sized lumber.
- Ladder safety: The OSHA-recommended 4:1 ratio means the base sits 1 foot out for every 4 feet of height. The actual ladder length needed for an 8-foot reach with a 2-foot base offset: √(8² + 2²) = √68 = 8.25 feet.
- TV size confusion: TVs are measured diagonally (corner to corner). A "55-inch" TV has a 55-inch diagonal, but its actual width is about 48 inches and height 27 inches. The diagonal is √(48² + 27²) = √2,304 + 729 = √3,033 ≈ 55. Useful for furniture planning.
- Soccer field goal angles: A player at 25 yards from goal at a 30-degree angle has a straight-line distance to goal of just over 25 yards but a more complex effective shot angle. Pythagorean math underlies the trigonometry coaches use to teach positioning.
- Aircraft and shipping navigation: Great-circle distance calculations on a sphere ultimately reduce to a Pythagorean-like formula in spherical trigonometry. The angle and arc-length calculations underlying flight planning all build on right-triangle math.
- Music theory, string lengths: Pythagoras himself discovered that musical harmony depends on string-length ratios. A string half as long sounds an octave higher. The diagonal frequencies derived from string ratios still underpin modern tuning theory.
The most beautiful proof in mathematics
There are hundreds of proofs of the Pythagorean theorem. One elegant visual proof: take a square with side length a+b. Inside it, arrange four right triangles with legs a and b, so they meet at a central square with side c (the hypotenuse). The big square has area (a+b)². It also equals 4 triangles plus the central square: 4 × (½ab) + c² = 2ab + c². Setting (a+b)² = 2ab + c²: expand to a² + 2ab + b² = 2ab + c². Subtract 2ab from both sides: a² + b² = c². Done.
Babylonian clay tablets from 1800 BC show that Pythagorean triples were known and tabulated long before Pythagoras. Plimpton 322 (a famous tablet held at Columbia University) lists 15 Pythagorean triples in remarkable detail, including non-obvious ones like (4,961, 6,480, 8,161). The Babylonians clearly understood the relationship; they just didn't have the formal "theorem and proof" structure that the Greeks developed.
The converse is also true: if a² + b² = c² for the three sides of a triangle, then the triangle MUST be a right triangle. This is the basis for the construction trick mentioned above, measure three lengths that satisfy 3² + 4² = 5², and you've proven the corner is a right angle.
FAQs
What is the Pythagorean theorem?
The Pythagorean theorem says: in a right triangle, the square of the hypotenuse (the longest side, opposite the right angle) equals the sum of the squares of the other two sides. Formula: a² + b² = c², where c is the hypotenuse and a, b are the legs.
When can you use the Pythagorean theorem?
Only for RIGHT triangles (one 90° angle). For non-right triangles, use the Law of Cosines: c² = a² + b² − 2ab·cos(C). The Pythagorean theorem is a special case where C = 90° and cos(90°) = 0.
How do you find the hypotenuse?
If you know both legs (a and b): c = √(a² + b²). Example: legs of 3 and 4. c = √(9 + 16) = √25 = 5.
How do you find a missing leg?
If you know the hypotenuse (c) and one leg (a): b = √(c² − a²). Example: c = 13, a = 5. b = √(169 − 25) = √144 = 12. The famous '3-4-5', '5-12-13', and '8-15-17' triangles are Pythagorean triples.
What is a Pythagorean triple?
A set of three positive integers (a, b, c) that satisfy a² + b² = c² for a right triangle. Famous examples: 3-4-5, 5-12-13, 8-15-17, 7-24-25, 20-21-29. Useful in building construction and geometry, you can create a perfect right angle by measuring a 3-4-5 triangle with any unit.
When was the Pythagorean theorem discovered?
Named after Greek philosopher Pythagoras (570-495 BC), but the relationship was known much earlier, Babylonian tablets dating to 1800 BC show Pythagorean triples. Indian, Chinese, and Egyptian mathematicians had also discovered it. Pythagoras may have been the first to prove it in Greek mathematics.