Pythagorean Theorem Calculator
Enter two sides of a right triangle to calculate the missing side using the Pythagorean theorem. Choose whether you are solving for a leg or the hypotenuse.
The Pythagorean theorem is one of the most famous results in mathematics: in any right triangle, the square of the hypotenuse equals the sum of squares of the other two sides. Written algebraically: a² + b² = c², where c is the hypotenuse (longest side, opposite the right angle) and a, b are the two legs. This 2500-year-old theorem, attributed to Pythagoras (c. 570-495 BC), underlies coordinate geometry, distance calculations, trigonometry, and countless practical applications.
The theorem works in only one direction: any right triangle satisfies the equation. Conversely, any three positive numbers a, b, c satisfying a² + b² = c² can be the sides of a right triangle (the converse). This bidirectional truth is what makes the theorem so powerful.
Famous "Pythagorean triples" — integer solutions to a² + b² = c² — appear throughout geometry: 3-4-5, 5-12-13, 8-15-17, 7-24-25, 20-21-29. These triples have been studied for thousands of years and remain useful for clean-number examples.
The theorem extends to: - **Distance formula**: distance between two points = √((x₂-x₁)² + (y₂-y₁)²) (Pythagorean applied to coordinates). - **3D space**: space diagonal = √(a² + b² + c²). - **Vectors**: magnitude = √(x² + y² + ...). - **Complex numbers**: modulus |a + bi| = √(a² + b²).
Common applications: construction (squaring corners), navigation, surveying, computer graphics, physics (vector magnitudes), trigonometry (foundation), and any problem involving right-triangle geometry.
Inputs
Results
Missing Side
5
Hypotenuse (c)
5
Leg a
3
Leg b
4
Triangle Area
6
Perimeter
12
Formula
How to use this calculator
- Choose: solve for hypotenuse or solve for leg.
- Enter the two known sides.
- Calculator returns the missing side.
- For hypotenuse: c = √(a² + b²).
- For leg: a = √(c² - b²).
- Verify: a² + b² should equal c² for right triangle.
Worked examples
TV diagonal
**Scenario:** 16:9 aspect ratio TV with width 32" and height 18". What's the diagonal (TV size)? **Calculation:** diagonal = √(32² + 18²) = √(1024 + 324) = √1348 ≈ 36.7". **Result:** ~37" diagonal TV. TV sizes are diagonal measurements. For exact 32" TV: width = 32 × 16/√(16² + 9²) ≈ 27.9"; height ≈ 15.7".
Ladder against wall
**Scenario:** 12 ft ladder. Base 4 ft from wall. How high does it reach? **Calculation:** height = √(12² - 4²) = √(144 - 16) = √128 ≈ 11.3 ft. **Result:** ~11.3 ft. Safe placement check: OSHA recommends ladder angle ~75° (ratio 1:4, base:height). Ratio here: 4:11.3 ≈ 1:2.8, much steeper. With 4 ft base, ladder is fairly steep — could be safer with bigger base distance.
Construction corner check
**Scenario:** Building a deck corner. Want to verify 90° angle. Measure 3 ft along one wall, 4 ft along other. Diagonal should be? **Calculation:** Diagonal = √(3² + 4²) = √25 = 5 ft. **Result:** If diagonal is exactly 5 ft, corner is 90°. If not, adjust. "3-4-5 method" — used by carpenters for centuries to verify square corners without complex tools.
When to use this calculator
**Use the Pythagorean theorem for:**
- **Finding missing sides** of right triangles. - **Distance calculations** between points (uses formula derived from theorem). - **Construction**: verifying right angles, sizing diagonal braces. - **Navigation**: straight-line distances. - **Computer graphics**: pixel distances, collision detection. - **Physics**: vector magnitudes (velocity, force). - **Roof and stair design**: rise/run/diagonal calculations. - **Trigonometry**: foundation for sin, cos, tan in right triangles.
**Only for right triangles:**
Pythagorean theorem works ONLY for right triangles. For other triangles: - **Law of Cosines**: c² = a² + b² - 2ab cos(C). - **Law of Sines**: a/sin(A) = b/sin(B) = c/sin(C).
Pythagorean is the special case when C = 90°.
**Identifying the hypotenuse:**
The hypotenuse is: - Always opposite the right angle. - Always the longest side. - Labeled "c" in standard notation.
The other two sides (legs, a and b) are adjacent to the right angle.
**Common Pythagorean triples to recognize:**
- 3-4-5 (and multiples: 6-8-10, 9-12-15, ...) - 5-12-13 (and multiples) - 7-24-25 - 8-15-17
Recognizing these saves calculation time.
**Generating new triples:**
For positive integers m > n: - a = m² - n² - b = 2mn - c = m² + n²
Examples: (m,n) = (2,1) → (3,4,5). (3,2) → (5,12,13). (4,1) → (15,8,17).
**Common applications:**
- **Construction**: verifying square corners, roof rafters, stair stringers. - **Carpentry**: diagonal bracing, frame squareness. - **Surveying**: indirect distance measurement. - **Architecture**: blueprint distances, room diagonals. - **Navigation**: straight-line ("as the crow flies") distances. - **Computer graphics**: pixel-distance calculations. - **Physics**: 2D vector resultant magnitudes. - **GPS/Mapping**: distance approximations. - **Sports**: trajectory analysis (e.g., baseball, golf).
**3D extension:**
For 3D coordinates: d = √((x₂-x₁)² + (y₂-y₁)² + (z₂-z₁)²)
Used in: - 3D graphics. - Astronomy. - Robotics. - Aerospace.
**Connection to other math:**
- **Trigonometry**: sin² + cos² = 1 (special case). - **Law of Cosines**: generalization to any triangle. - **Distance formula**: Pythagorean in coordinate plane. - **Vector magnitude**: |v| = √(sum of squares). - **Complex modulus**: |a + bi| = √(a² + b²).
**Software:**
- **Calculator**: simple formula. - **Excel**: =SQRT(A1^2 + B1^2). - **Python**: math.sqrt(a**2 + b**2) or math.hypot(a, b). - **CAD**: built into distance and dimension tools. - **GIS**: distance calculations.
**Why "Pythagorean"?**
Attributed to Pythagoras (Greek mathematician, 570-495 BC) who reportedly proved the theorem. But it was known earlier — Babylonian tablets (c. 1900 BC) list Pythagorean triples. Several Chinese, Indian, and Egyptian texts include proofs. Pythagoras gets credit for first deductive proof in Western mathematics.
**Number of proofs:**
Over 370 distinct proofs of Pythagorean theorem exist — geometric, algebraic, trigonometric. Includes proofs by President James Garfield (1881) and Einstein (as a teenager).
**Pitfalls:**
- **Using on non-right triangles**: only works for right triangles. - **Wrong identification of hypotenuse**: must be opposite right angle. - **Forgetting to take square root**: result is c², not c. - **Subtracting wrong side**: for leg, subtract from hypotenuse squared. - **For decimals**: most triangles have irrational hypotenuse. - **3D vs 2D**: include z-coordinate when needed. - **Confusing with distance formula**: same idea, different setup.
Common mistakes to avoid
- Applying Pythagorean theorem to non-right triangles.
- Confusing the hypotenuse (longest side, opposite right angle) with a leg.
- Forgetting to take the square root at the end.
- For solving for a leg: subtracting in wrong direction.
- Using on triangle with three given sides without verifying it's right.
- Mixing units (e.g., legs in cm, hypotenuse in m).
- For 3D problems: forgetting the z-component.
- For distance formula: forgetting to square both differences.