Pythagorean Theorem Calculator

The Pythagorean theorem is geometry's most used fact: the square on a right triangle's longest side equals the two other squares added up, or a² + b² = c². Carpenters quote it as the 3-4-5 triangle, and any diagonal — a ladder on a wall, a screen corner to corner — is one square root away. This calculator runs it both ways: hypotenuse from two legs, or a missing leg from the hypotenuse and its partner.

Enter values

A leg in hypotenuse mode; the hypotenuse in leg mode

Results update as you type.

Results

Hypotenuse
5
Pythagoras check
3² + 4² = 5²
Given legs
3 and 4

How is the Pythagorean Theorem calculated?

A menu chooses the direction. In hypotenuse mode both inputs are the triangle's legs and the calculator squares them, adds, and takes the square root. In leg mode the first input is the hypotenuse and the second the known leg: the squares are subtracted instead. The page checks the geometry before computing — a hypotenuse must be strictly longer than any leg — and prints the arithmetic as a plain equation so you can verify the answer by eye.

Formula

c = √(a² + b²) finds the hypotenuse c from the legs a and b; a = √(c² − b²) rearranges it to find a missing leg, given a hypotenuse longer than that leg. a and b flank the right angle; c is opposite it and always the longest. Squaring both sides of the theorem converts lengths into the addition or subtraction this calculator performs.

Example

Legs of 3 and 4 units: 3² + 4² = 9 + 16 = 25, and √25 = 5, so the hypotenuse is 5 — the smallest whole-number right triangle there is. Run it backwards with hypotenuse 5 and one leg 3: 5² − 3² = 25 − 9 = 16, and √16 = 4, so the missing leg is 4. A 6 m ladder standing 2 m from a wall reaches √(36 − 4) = √32 ≈ 5.657 m up it.

Things to remember

The theorem runs both ways, and the classic mistake is misidentifying the hypotenuse — which is why this page demands the longer side before subtracting. Whole-number triples like 3-4-5 check drawings instantly. For triangles without a right angle, the triangle calculator and Heron's formula take over.

Frequently Asked Questions

How do you find the hypotenuse of a right triangle?

Square both legs, add the results and take the square root: legs 3 and 4 give 9 + 16 = 25, so the hypotenuse is √25 = 5. The hypotenuse is always the side opposite the right angle and always the longest of the three.

How do you find a missing leg with Pythagoras?

Subtract the known leg's square from the hypotenuse's square and take the root. With hypotenuse 5 and leg 3, that is 25 − 9 = 16, giving a leg of 4. The subtraction only works because the hypotenuse is the longest side — the calculator enforces that before computing.

What is the 3-4-5 rule in carpentry?

It is the theorem in whole numbers: measuring 3 units along one edge, 4 along the other, and confirming a 5 unit diagonal proves the corner is square. Scaled up it becomes 6-8-10 or 9-12-15, which is how builders check door frames and foundations without any angle tool.

Does the Pythagorean theorem work for any triangle?

No — only for right-angled ones. Without a right angle the squares no longer balance: sides 2, 3 and 4 satisfy neither a² + b² = c² nor its reverse. For such triangles, three sides still give the area through Heron's formula on the triangle calculator page.