Pythagorean Theorem Calculator

Result
—

Formulas

c = √(a² + b²)

What is the Pythagorean theorem?

The Pythagorean theorem is a rule that holds in every right triangle — a triangle with one 90° angle. Square the two shorter sides (the legs, a and b), add them, and the total equals the square of the longest side (the hypotenuse, c).

Named after the Greek mathematician Pythagoras, the rule has been used for thousands of years to check square corners in construction and to measure distances that cannot be walked — like the straight line across a park or lake.

How to use this Pythagorean theorem calculator

  1. Choose what to Solve for: the hypotenuse (c) or a leg (a or b).
  2. Enter the two known sides. For the hypotenuse, give both legs; for a leg, give the hypotenuse and the other leg — the field labels update to guide you.
  3. Press Calculate and the missing side appears as the result.
  4. Press C to clear the inputs.

The formula and how to rearrange it

One equation, three uses — depending on which side is unknown, rearrange it and take a square root:

a² + b² = c² c = √(a² + b²) a = √(c² − b²)

Example 1: hypotenuse of legs 6 m and 8 m

Square the legs: 6² + 8² = 36 + 64 = 100. The hypotenuse is √100 = 10 m.

c = 10 m

Example 2: a missing leg with c = 13, b = 5

When a leg is missing, subtract instead of add: 13² − 5² = 169 − 25 = 144. The missing leg is √144 = 12.

a = 12

Example 3: shortcut across a 30 m × 40 m park

Walking around two sides covers 30 + 40 = 70 m. Cutting the diagonal: √(30² + 40²) = √(900 + 1600) = √2500 = 50 m — a 20 m saving.

Diagonal = 50 m (saves 20 m)

Triples and sanity checks

Some right triangles have three whole-number sides, called Pythagorean triples: (3, 4, 5), (5, 12, 13) and (8, 15, 17). Any multiple works too, like (6, 8, 10). Builders still stretch a 3-4-5 rope to test corners today.

Two quick sanity checks: the hypotenuse must be the longest side, yet always shorter than the two legs added together. And the theorem only applies to right triangles — on any other shape it gives wrong answers, so confirm the 90° angle first.

Frequently asked questions

Does the Pythagorean theorem work for every triangle?

No — only for right triangles with exactly one 90° angle. For any triangle, the law of cosines generalizes the idea, and it simplifies to a² + b² = c² when the angle is 90°.

What is a Pythagorean triple?

Three whole numbers that satisfy a² + b² = c², such as 3-4-5, 5-12-13 or 8-15-17. Multiplying every number by the same factor produces another valid triple, like 6-8-10 or 9-12-15.

How can I tell which side is the hypotenuse?

It is always the side opposite the right angle and always the longest of the three. If your result comes out shorter than one of the inputs, the values were typed into the wrong boxes.

Who was Pythagoras?

A Greek mathematician born around 570 BC whose school proved the theorem that carries his name. Babylonian clay tablets show the rule was already known over a thousand years earlier.