Why this matters
The Pythagorean theorem is one of the most frequently used formulas in applied mathematics, yet computing square roots by hand or on a basic calculator introduces rounding errors that compound in multi-step problems. Whether you are laying out a foundation, calculating a diagonal bracing length, or determining the shortest distance between two points on a coordinate plane, you need an exact answer fast.
The theorem states that in any right triangle, the sum of the squares of the two legs equals the square of the hypotenuse. This relationship is the foundation for distance formulas, vector magnitude calculations, and trigonometric identities. A dedicated calculator that solves for the missing side and shows the intermediate steps helps you verify your manual work and catch errors before they propagate into a larger calculation.
Beyond academics, this formula appears constantly in construction, navigation, game development, and physics. Any time you need to know how far apart two points are when you know their horizontal and vertical separation, you are using the Pythagorean theorem. Having a tool that handles the square root and subtraction for you eliminates arithmetic mistakes and saves time on repetitive calculations.
Solve modes and formulas
| Known Sides | Missing Side | Formula Used |
|---|---|---|
| a, b (both legs) | c (hypotenuse) | c = square root of (a squared + b squared) |
| a, c (leg + hypotenuse) | b (other leg) | b = square root of (c squared minus a squared) |
| b, c (leg + hypotenuse) | a (other leg) | a = square root of (c squared minus b squared) |
How to use it
Enter values for any two of the three sides (a, b, and c). Leave the side you want to solve for completely empty.
The calculator detects which field is blank and applies the correct formula automatically.
The result appears instantly along with the formula written out step by step so you can follow the math.
Decimal inputs are supported — enter 3.5 for a leg and 5.0 for the hypotenuse, and the tool computes the exact missing value.
Testing your result
Start with the classic 3-4-5 triangle. Enter a = 3 and b = 4, leave c empty, and confirm the result is exactly 5. Then solve for a leg: enter b = 4 and c = 5, leave a empty, and verify the answer is 3. These integer triplets are the most reliable sanity check because the square roots resolve to whole numbers with no rounding.
Next, test with decimal values that produce irrational results. Enter a = 1 and b = 1, and confirm c is approximately 1.4142. Then enter c = 10 and a = 6 to solve for b, which should be exactly 8 (since 6-8-10 is a scaled 3-4-5 triangle). Finally, test the error case by entering c = 3 and a = 5 — the hypotenuse cannot be shorter than a leg, and the tool should display a clear validation error.
Common mistakes
Entering a hypotenuse value that is smaller than one of the legs, which is geometrically impossible and triggers a validation error.
Filling in all three fields instead of leaving the unknown side blank, which gives the calculator no indication of what to solve for.
Confusing which side is the hypotenuse — it is always the longest side and always opposite the right angle, not whichever side you label c.
Rounding intermediate values when doing manual checks, which can make your hand-calculated result differ slightly from the tool's full-precision output.
Edge cases and options
The tool validates the triangle inequality before computing. If you enter two legs whose sum of squares does not correspond to a valid hypotenuse, or if you enter a hypotenuse shorter than a leg, the calculator reports the error immediately rather than returning a nonsensical result or attempting to take the square root of a negative number.
All computation uses JavaScript's floating-point arithmetic, which provides about 15 significant digits of precision. For the vast majority of practical applications — construction measurements, screen dimensions, game physics — this is more than adequate. If you are working with extremely large values where floating-point precision matters, be aware that the last few digits may carry rounding artifacts.
Real-world use cases
A carpenter calculating the diagonal length of a rectangular cabinet face to cut a brace that fits precisely corner to corner.
A game developer computing the distance between two entities in 2D space to determine whether a projectile has reached its target.
A surveyor finding the straight-line distance between two points on a site plan when only the east-west and north-offsets are known.
Frequently asked questions
Q: What is the Pythagorean theorem?
A: In a right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a squared plus b squared equals c squared. This relationship holds for every right triangle and is used to find any missing side when the other two are known.
Q: How do I solve for the hypotenuse?
A: Leave the c field empty and enter values for both legs a and b. The calculator returns c as the square root of (a squared plus b squared), with the full formula shown in the result.
Q: How do I solve for a missing leg?
A: Leave the unknown leg field empty and enter the other leg plus the hypotenuse. The calculator subtracts the known leg squared from the hypotenuse squared and takes the square root to find the missing leg.
Q: What if c is smaller than one of the legs?
A: The hypotenuse is always the longest side of a right triangle. If your input violates this, the calculator shows a clear error rather than attempting an impossible square root of a negative number.
Q: Does this work with non-integer values?
A: Yes — decimal inputs are fully supported. The tool works with any positive real numbers, returning results to full floating-point precision.
Start using it now
Try the Pythagorean Theorem Calculator tool. See also Triangle Calculator, Circle Calculator, and Quadratic Equation Solver.