Pythagorean Theorem Calculator
Use this free Pythagorean theorem calculator to find a missing side of a right triangle. Enter any two sides — the two legs to find the hypotenuse, or the hypotenuse plus one leg to find the other leg — and get the missing side instantly, along with the triangle's area and perimeter. Every step of the math is shown so you can check the working.
Enter your numbers
Choose what you're solving for, then enter the two sides you know. Results update as you type.
Your results
How to use this calculator
Pick the mode that matches your problem. Find hypotenuse is the classic case: you know the two legs — the sides that meet at the right angle — and you need the longest side across from it. Find a leg is the reverse: you know the hypotenuse (the longest side) and one leg, and you need the other leg. Enter any positive numbers in any unit; as long as both sides use the same unit, the answer comes out in that unit.
Everything recalculates the moment you type, so you can experiment — try the famous 3-4-5 or 5-12-13 triples and watch the math confirm them. The result panel always shows the exact substitution used, plus the triangle's area and perimeter as a bonus.
If your inputs can't describe a real right triangle, you'll get a plain-language error instead of a wrong answer. In particular, when finding a leg, the hypotenuse must be longer than the known leg — a hypotenuse can never be shorter than a leg of the same triangle.
How it works
The Pythagorean theorem says that in a right triangle, the squares of the two legs add up to the square of the hypotenuse: a² + b² = c². The hypotenuse c is always the side opposite the 90° angle, and it is always the longest of the three sides.
To find the hypotenuse, solve for c: c = √(a² + b²). For legs of 3 and 4: c = √(3² + 4²) = √(9 + 16) = √25 = 5. For legs of 5 and 12: c = √(25 + 144) = √169 = 13.
To find a leg, rearrange to b = √(c² − a²): subtract the known leg's square from the hypotenuse's square, then take the square root. With a hypotenuse of 10 and a known leg of 6: b = √(100 − 36) = √64 = 8. This mode only works when c > a; otherwise the expression under the square root is zero or negative and no such triangle exists.
As a bonus, the calculator also gives the triangle's area = (a × b) ÷ 2 — a right triangle is exactly half the rectangle built on its legs — and its perimeter = a + b + c.
Assumptions: this theorem applies only to right triangles (one 90° angle). All sides are positive and in the same unit. Results are exact mathematical values, not estimates; displayed values are rounded to 6 significant digits.
Frequently asked questions
What is the Pythagorean theorem?
The Pythagorean theorem says that in a right triangle (a triangle with a 90-degree angle), the squares of the two legs add up to the square of the hypotenuse: a squared + b squared = c squared, where c is the side opposite the right angle. It only applies to right triangles, never to other shapes.
How do you find the hypotenuse of a right triangle?
Take the square root of the sum of the squares of the two legs: c = square root of (a squared + b squared). For legs of 3 and 4, the hypotenuse is the square root of (9 + 16) = the square root of 25 = 5. Choose the "Find hypotenuse" mode in this calculator and it does the math for you.
How do you find a missing leg if you know the hypotenuse?
Rearrange the formula to b = square root of (c squared - a squared): subtract the known leg's square from the hypotenuse's square, then take the square root. For example, with a hypotenuse of 10 and a leg of 6, the missing leg is the square root of (100 - 36) = the square root of 64 = 8. The hypotenuse must be longer than the leg — if it isn't, the inputs can't describe a real right triangle.
How is this different from the triangle area calculator?
This Pythagorean theorem calculator solves for a missing side of a right triangle using a squared + b squared = c squared — it finds a length you don't know. The triangle area calculator only computes the area, and it works for any triangle, not just right ones. Use this one when a side length is unknown; use the area calculator when you have all the measurements and just want the area.