Skip to content
Calculator.hair

Pythagorean Theorem Calculator

Leg a: a number, or the multiplier in front of the square root on the right

Leg b

Hypotenuse c, the side opposite the right angle

Press Calculate to see the results.

Enter any two sides of a right triangle and this Pythagorean theorem calculator finds the third from a² + b² = c². Values such as 2√5 can be typed directly, and the answer is shown in simplified radical form when possible.

Leave the unknown side blank and fill in the other two. The legs a and b meet at the right angle and the hypotenuse c is always the longest side, so c must be larger than whichever leg you give. With the default values, a = 2 and c = 2√5, the missing leg is b = √(20 − 4) = 4.

Pythagorean Theorem

The Pythagorean theorem states that in any right triangle, the area of the square built on the hypotenuse equals the sum of the areas of the squares built on the two legs. Written as an equation, a² + b² = c². It applies only to triangles with a 90° angle, and the converse also holds: if three lengths satisfy a² + b² = c², the triangle they form must contain a right angle.

The relationship is named after Pythagoras of Samos, the Greek philosopher of the sixth century BC, but it was known long before him. A Babylonian clay tablet called Plimpton 322, written around 1800 BC, lists sets of numbers that fit the rule, and Indian and Chinese texts also describe it independently. Euclid gave a famous proof in his Elements around 300 BC, and hundreds of different proofs have been published since, including one by U.S. President James Garfield.

One of the simplest proofs rearranges four copies of the triangle inside a square of side a + b. Placed one way, the four triangles leave a tilted square hole of area c². Placed another way, they leave two square holes of areas a² and b². The big square and the triangles are the same in both arrangements, so the holes must have equal total area: c² = a² + b².

Whole numbers that satisfy the equation are called Pythagorean triples. The best known is 3, 4, 5, and multiplying a triple by any whole number gives another, such as 6, 8, 10. A triple with no common factor is called primitive. Builders have long used the 3-4-5 triple to lay out square corners: measure 3 units along one wall, 4 along the other, and adjust until the diagonal is exactly 5.

The theorem is behind everyday calculations of distance. The straight-line distance between points (x₁, y₁) and (x₂, y₂) on a map or graph is √((x₂ − x₁)² + (y₂ − y₁)²), which is just the hypotenuse of the triangle formed by the horizontal and vertical differences. The same idea gives a screen's diagonal from its width and height, the length of a ladder needed to reach a window, and the length of a ramp from its rise and run. In three dimensions, the diagonal of a box with sides l, w and h is √(l² + w² + h²).

abcPrimitive?
345Yes
51213Yes
6810No (2 × 3-4-5)
72425Yes
81517Yes
94041Yes
202129Yes
123537Yes
116061Yes
284553Yes
abca²b²c²
a² + b² = c²: here 9 + 16 = 25.

a² + b² = c²

a, b
the legs, the two sides that form the right angle
c
the hypotenuse, the side opposite the right angle

Rearranged: c = √(a² + b²), a = √(c² − b²), b = √(c² − a²).

When the missing side is not a whole number, the exact answer is a square root. The calculator simplifies it by pulling out perfect-square factors: √20 = √(4 × 5) = 2√5, and √72 = √(36 × 2) = 6√2. The decimal value is shown alongside for measuring and building.

Frequently asked questions

What is the Pythagorean theorem?

In a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c².

How do I find a missing leg?

Subtract the square of the known leg from the square of the hypotenuse and take the square root: b = √(c² − a²).

Does the theorem work for any triangle?

No. It holds only for right triangles. For other triangles use the law of cosines, c² = a² + b² − 2ab·cos C.

What is a Pythagorean triple?

Three whole numbers that satisfy a² + b² = c², such as 3-4-5, 5-12-13 and 8-15-17.

Can I enter a square root as a side?

Yes. Type values such as 2√5, √7 or sqrt(3); the calculator evaluates them exactly before solving.

Updated by Calculator.hair. How we build and check our calculators