Skip to content

Pythagorean Theorem Calculator

Solve one missing right-triangle side with a^2 + b^2 = c^2. Leave exactly one side as 0.

Maintained by the Calcenzo team. Last reviewed September 25, 2026. Methodology

Pythagorean Theorem Calculator

A pythagorean theorem calculator finds the missing side of a right triangle using a² + b² = c². Legs of 3 and 4 give a hypotenuse of 5.

pythagorean theorem calculator
Pythagorean theorem calculator chart: missing side examples.

How to use the pythagorean theorem calculator

  1. Enter the two sides you know.
  2. Enter 0 for the side you want.
  3. Read the missing side.

How the pythagorean theorem calculator works

The pythagorean theorem calculator solves for one missing side of a right triangle. You enter the two legs a and b and the hypotenuse c, leaving exactly one of them as 0. That zero marks the side to find. The tool then uses:

  • c = √(a² + b²) when the hypotenuse is missing
  • a = √(c² − b²) or b = √(c² − a²) when a leg is missing

The answer is shown to six decimal places. If no side or more than one side is 0, or if the hypotenuse is not the longest side, the tool shows a message instead.

The theorem

In any right triangle, the square on the hypotenuse equals the sum of the squares on the two legs: a² + b² = c². The hypotenuse is the side opposite the right angle and is always the longest side. The rule works only for right triangles; for other triangles, use the law of cosines.

Pythagorean theorem calculator worked example

A ladder leans against a wall with its foot 6 ft from the wall and reaches 8 ft up. The ladder is the hypotenuse: c = √(6² + 8²) = √100 = 10 ft. Now suppose a 13 ft ladder stands 5 ft from the wall. Enter a = 0, b = 5, c = 13, and the pythagorean theorem calculator gives a = √(169 − 25) = 12 ft. The table lists more cases.

a b c Result
3 4 0 c = 5
5 12 0 c = 13
8 15 0 c = 17
1 1 0 c = 1.414214
0 5 13 a = 12
6 0 10 b = 8

Pythagorean triples

Some right triangles have whole-number sides, called Pythagorean triples. The best known are 3-4-5, 5-12-13, 8-15-17 and 7-24-25. Any multiple of a triple is also a triple, so 6-8-10 and 30-40-50 work too. Builders use the 3-4-5 rule to check square corners: measure 3 ft along one wall and 4 ft along the other, and the diagonal should be exactly 5 ft.

Real-world uses

The theorem gives the diagonal of a screen or room, the straight-line distance between two map points, the length of a roof rafter from rise and run, and the length of a ramp. A TV that is 48 in wide and 27 in tall has a diagonal of √(48² + 27²) ≈ 55.07 in, which is sold as a 55-inch screen. In coordinates, the distance between (x₁, y₁) and (x₂, y₂) is √((x₂ − x₁)² + (y₂ − y₁)²), the same formula.

Answers that are not whole numbers

Most triangles do not give whole numbers. A square with 1 unit sides has a diagonal of √2 ≈ 1.414214. The pythagorean theorem calculator shows the decimal; if your class wants an exact form, keep the square root, such as √2 or 5√2. Round only at the final step to avoid errors adding up.

Units

Use the same unit for every side. If one leg is in feet and the other in inches, convert first. The answer is in the same unit you entered.

A short history

The rule is named after the Greek mathematician Pythagoras, but Babylonian clay tablets from about 1800 BCE already list triples such as 3-4-5 and much larger ones. Hundreds of proofs exist today, including one by U.S. President James Garfield. A common visual proof arranges four copies of the triangle inside a square of side a + b, leaving a square of area c² in the middle.

Tips

  • Leave exactly one side as 0.
  • Make sure the hypotenuse is the longest side when you enter it.
  • Check whole-number answers against common triples.
  • Use the pythagorean theorem calculator to check the square root step in homework.

Related calculators:

Sources

OpenStax Prealgebra 2e, 9.3: Triangles and the Pythagorean theorem.

Formula and method

If c unknown: c = sqrt(a^2 + b^2). If a unknown: a = sqrt(c^2 - b^2). If b unknown: b = sqrt(c^2 - a^2).

Leave exactly one of a, b, c as 0. Legs must be positive when solving c. When solving a leg, hypotenuse must exceed the known leg.

Questions about this calculator

What is the Pythagorean theorem?

a² + b² = c² in a right triangle.

How do I find a leg?

a = √(c² − b²).

Does it work for any triangle?

No, only right triangles.

What is a Pythagorean triple?

Whole-number sides such as 3-4-5.

Which side do I set to 0?

The side you want to find.

Check the assumptions and units before relying on a result. Financial, tax and health estimates do not replace advice for your individual circumstances.

Report a calculation issue