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).

FreeInstant resultNo signup
Copied

Reviewed & updated for 2026 by Methodology & sources · How we calculate

Common Pythagorean triples

abcVerification
3459 + 16 = 25 ✓
5121325 + 144 = 169 ✓
7242549 + 576 = 625 ✓
8151764 + 225 = 289 ✓
9404181 + 1600 = 1681 ✓
202129400 + 441 = 841 ✓
116061121 + 3600 = 3721 ✓

Why this ancient 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. A recommendation system can compare users by their distance in a feature space with many dimensions, 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.
  • 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: OSHA's rule for a leaning ladder (29 CFR 1926.1053(b)(5)(i)) puts its foot about one-quarter of the ladder's working length out from the top support. A 12-foot working length therefore stands 3 feet out and reaches √(12² − 3²) = √135 = 11.62 feet up the wall.
  • TV size confusion: TVs are measured diagonally (corner to corner). A "55-inch" TV has a 55-inch diagonal; on a 16:9 screen that is about 47.9 inches wide and 27.0 inches tall, and √(47.9² + 27.0²) comes back to 55. Useful for furniture planning.
  • 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.

The most beautiful proof in mathematics

There are many 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.

Old Babylonian clay tablets show that Pythagorean triples were known and tabulated long before Pythagoras. Plimpton 322, a tablet held at Columbia University, records non-obvious ones such as (4,961, 6,480, 8,161): 4,961² + 6,480² = 8,161² exactly. The Babylonians clearly used the relationship; the formal "theorem and proof" structure came later, from the Greeks.

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, 7-24-25, 8-15-17, 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?

It carries the name of the Greek philosopher Pythagoras, but people were using the relationship long before him: Old Babylonian scribes recorded whole-number triples on clay, and early Indian and Chinese texts state it too. Greek tradition credits Pythagoras or his followers with a proof.

Related

Hypotenuse (c)

—

Enter sides

a²—
b²—
c²—
Triangle area—
Perimeter—
Pythagorean triple?—