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
- Choose what to Solve for: the hypotenuse (c) or a leg (a or b).
- 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.
- Press Calculate and the missing side appears as the result.
- 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.