Pythagorean Theorem Calculator

Find the missing side of a right triangle. Enter any two sides to find the third.

Enter any two values to find the third.

Result
—
Enter values and click calculate

Common Pythagorean Triples

The Pythagorean Theorem

In a right triangle, the square of the hypotenuse equals the sum of squares of the other two sides.

a² + b² = c²

Finding Each Side

  • Hypotenuse: c = √(a² + b²)
  • Leg a: a = √(c² − b²)
  • Leg b: b = √(c² − a²)

What Is the Pythagorean Theorem?

In any right triangle — one with a 90° corner — the square of the longest side (the hypotenuse, opposite the right angle) equals the sum of the squares of the two shorter sides (the legs). Written a² + b² = c², it is arguably the most famous equation in mathematics, used for over 3,000 years in construction, navigation, and surveying. Its power is practical: know any two sides of a right triangle and you can always find the third. Builders use it to square foundations with the 3-4-5 rule, GPS receivers use its three-dimensional cousin to triangulate positions from satellites, and it is the hidden reason the distance formula works in coordinate geometry.

Pythagorean Triples

Some whole-number sets satisfy the theorem exactly and are called Pythagorean triples — the smallest is (3, 4, 5), since 9 + 16 = 25. Others include (5, 12, 13), (8, 15, 17), and (7, 24, 25).

Any multiple of a triple is also a triple: (6, 8, 10) is just (3, 4, 5) doubled. Spotting a triple saves work — legs of 5 and 12 mean the hypotenuse is 13 immediately, no calculator needed.

Step-by-Step Calculation

Step 1: Confirm the triangle has a right angle. The theorem applies only to right triangles — nothing else.

Step 2: Identify the hypotenuse: the longest side, sitting opposite the right angle. Call it c.

Step 3: Finding the hypotenuse: square both legs, add them, and take the square root — c = √(a² + b²).

Step 4: Finding a missing leg: square the hypotenuse, subtract the square of the known leg, and take the square root — a = √(c² − b²).

Step 5: Check the answer: the hypotenuse must be the longest side and each leg shorter than it. If that fails, recheck which side is which.

Worked Examples

Example 1: Finding the hypotenuse

Legs 3 and 4: c = √(9 + 16) = √25 = 5.

Example 2: Finding a leg

Hypotenuse 13, leg 5: b = √(169 − 25) = √144 = 12.

Example 3: A ladder problem

A 10-foot ladder leans against a wall with its base 6 feet out from the wall. The height it reaches is √(100 − 36) = √64 = 8 feet. The ladder is the hypotenuse here — a common point of confusion.

Example 4: A triple, no decimals

Legs 5 and 12: c = √(25 + 144) = √169 = 13. Recognizing the (5, 12, 13) triple gives the answer instantly.

Common Mistakes

  • Using it on non-right triangles: without a 90° angle the theorem simply does not hold — use the law of cosines instead.
  • Adding instead of subtracting for a leg: the hypotenuse square is the largest, so a leg is √(c² − b²), never plus.
  • Forgetting the final square root: a² + b² gives c², not c. The root is not optional.
  • Misidentifying the hypotenuse: it is always the longest side and always opposite the right angle — label it first.

Frequently Asked Questions

Does the theorem work in 3D? Yes — the space diagonal of a box is d = √(l² + w² + h²), which is the theorem applied twice.

What is the converse of the theorem? If a² + b² = c² holds for a triangle’s sides, the triangle must be right-angled. Builders use this to verify square corners with a 3-4-5 triangle of rope.

Who discovered it? It is named for Pythagoras (c. 570–495 BCE), though Babylonian tablets show it in use a thousand years earlier.

Can the hypotenuse be shorter than a leg? Never. Since c² = a² + b², c² exceeds either leg’s square, so c is always the longest side.

Proving the Theorem: A One-Paragraph Sketch

One classic proof arranges four copies of the right triangle inside a large square of side (a + b). The large square's area is (a + b)². Inside, the four triangles cover 4 × (½ab) = 2ab, leaving an inner tilted square of side c with area c². So (a + b)² = 2ab + c²; expanding gives a² + 2ab + b² = 2ab + c², and canceling 2ab leaves a² + b² = c². Hundreds of proofs exist — including one by U.S. President James Garfield — but this rearrangement is the simplest to picture.

The Converse: Testing for a Right Angle

The theorem works in reverse too: if a triangle's sides satisfy a² + b² = c², the triangle must contain a right angle opposite the longest side. Builders exploit this with the 3-4-5 rule — measure 3 units along one edge, 4 along the other, and if the diagonal is exactly 5, the corner is square. To test sides 8, 15, 17: 8² + 15² = 64 + 225 = 289 = 17², so the triangle is right-angled.

Common Pythagorean Triples

abcCheck (a² + b² = c²)
3459 + 16 = 25
5121325 + 144 = 169
8151764 + 225 = 289
7242549 + 576 = 625
202129400 + 441 = 841
9404181 + 1600 = 1681
681036 + 64 = 100
9121581 + 144 = 225

The Distance Formula: The Theorem in Disguise

The distance between two points (x₁, y₁) and (x₂, y₂) is just the hypotenuse of the triangle formed by their horizontal and vertical gaps:

d = √[(x₂ − x₁)² + (y₂ − y₁)²]

Example: from (1, 2) to (4, 6), the gaps are 3 and 4, so d = √(9 + 16) = √25 = 5. GPS receivers, maps, and video games all run this calculation constantly.

The Theorem in 3D and Real Life

The same idea extends to three dimensions: the space diagonal of a box with length l, width w, and height h is d = √(l² + w² + h²) — the theorem applied twice. For a 3 × 4 × 12 box: d = √(9 + 16 + 144) = √169 = 13. That is how you check whether a long object fits diagonally inside a carton.

Screen sizes are the theorem at work too: a 55-inch 16:9 TV is 55 × 16/√337 ≈ 47.9 inches wide and 55 × 9/√337 ≈ 27.0 inches tall, because 16² + 9² = 337.

Beyond Right Triangles

The law of cosines, c² = a² + b² − 2ab·cos(C), generalizes the theorem to any triangle: when the angle C is 90°, cos(C) = 0 and the formula collapses back to a² + b² = c². For triangles with no right angle, reach for the law of cosines instead.

>