Pythagorean Theorem Calculator
Solve for a missing side of a right triangle — the hypotenuse or either leg — using the Pythagorean theorem, given the other two known sides.
How It's Calculated
Formula
c = \sqrt{a^2 + b^2}\\ a = \sqrt{c^2 - b^2}\\ b = \sqrt{c^2 - a^2}The Pythagorean theorem describes a fixed relationship between the three sides of any right triangle (a triangle with one 90-degree angle): the square of the hypotenuse (the longest side, opposite the right angle) equals the sum of the squares of the other two sides, called legs. Written as a formula, a² + b² = c², where a and b are the legs and c is the hypotenuse. Because this is an equation with three variables, knowing any two of the three sides lets you solve for the third algebraically. Solving for the hypotenuse (c = √(a² + b²)) is always possible for any two positive leg lengths — there is no additional constraint between two legs. Solving for a leg (a = √(c² − b²), or b = √(c² − a²)) requires the known hypotenuse to be strictly greater than the known leg, because the hypotenuse is always the longest side of a right triangle; if the "hypotenuse" you enter is not actually longer than the known leg, the two values cannot describe a real right triangle, and this calculator reports that clearly instead of computing a nonsensical result.
Worked Examples
Solve for the hypotenuse: legs 3 and 4 (the classic 3-4-5 triangle)
- Formula: c = √(a² + b²)
- Substitute: c = √(3² + 4²) = √(9 + 16)
- c = √25 = 5
- The hypotenuse is 5.
Solve for a leg: hypotenuse 5 and leg b 4
- Formula: a = √(c² − b²)
- Check the hypotenuse is longer than the known leg: 5 > 4, so this is a valid right triangle.
- Substitute: a = √(5² − 4²) = √(25 − 16)
- a = √9 = 3
- The missing leg is 3.
Frequently Asked Questions
How is this different from the Triangle Calculator?
This Pythagorean Theorem Calculator solves for a single MISSING side of a right triangle when you already know the other two sides. The Triangle Calculator instead takes three given side lengths for any triangle (not necessarily a right triangle) and validates whether they form a real triangle, then computes its perimeter, area, and side classification (equilateral, isosceles, or scalene). Use this calculator when you're missing one right-triangle side; use the Triangle Calculator when you have all three sides and want to check validity, area, or classification.
Why do I need to choose which side I'm solving for?
The Pythagorean theorem relates three sides, but the two you already know and the one you're missing determine which rearrangement of a² + b² = c² actually applies. Solving for the hypotenuse uses c = √(a² + b²); solving for a leg instead subtracts inside the square root (a = √(c² − b²), or b = √(c² − a²)). Selecting a mode tells the calculator which two sides you're providing and which formula to apply.
Why does the calculator reject some hypotenuse/leg combinations?
In any right triangle, the hypotenuse is always the longest side — it's opposite the 90-degree angle. When solving for a leg, this calculator requires your entered hypotenuse value to be strictly greater than your entered known leg. If it isn't (for example, entering a "hypotenuse" of 4 with a known leg of 5), those two numbers cannot describe a real right triangle, so the calculator reports the problem clearly instead of taking the square root of a negative number, which would be mathematically meaningless.
Can the known sides be decimal (non-integer) values?
Yes. The Pythagorean theorem works identically for decimal side lengths — for example, legs of 1.5 and 2 produce a hypotenuse of exactly 2.5 (1.5² + 2² = 2.25 + 4 = 6.25, and √6.25 = 2.5). Any positive, finite number is accepted for either known side.
Why do both known-side fields say their meaning depends on the mode?
This calculator uses two generic fields — "Known Side 1" and "Known Side 2" — for all three modes rather than a separate set of labeled fields per mode, so switching modes doesn't require re-learning a new form layout. Each field's helper text spells out exactly what it means in every mode, and the "Formula Used" result restates which formula and which sides produced your answer.