Pythagorean Theorem Calculator
This calculator finds a missing side of a right triangle from two known lengths using the Pythagorean theorem. Choose whether the unknown is the hypotenuse or a leg, then enter both known measurements in the same unit.
By Dr. Hassan Khames EliwaLast updated
Result
How it works
Identify the right angle first
For a right triangle, the two perpendicular sides are legs and the side opposite the right angle is the hypotenuse. The relationship is a² + b² = c², with c reserved for the hypotenuse. It is not a formula for every triangle. A sketch that merely looks square is not enough evidence that an actual corner is ninety degrees.
In hypotenuse mode, enter the two legs in the a and b fields. The output is the square root of their squared sum. Internally, a hypotenuse routine avoids unnecessary overflow when combining the lengths. The accepted dimensions are positive finite numbers no larger than one trillion, keeping the supported calculation comfortably within numeric limits.
Recover a missing leg
In missing-leg mode, the first input is the known leg and the second is the hypotenuse. The missing side is √(c² − a²). The hypotenuse must be strictly longer than the known leg; equality would collapse the triangle into a line and a shorter hypotenuse is geometrically impossible. The implementation evaluates the equivalent expression √(c − a) × √(c + a).
Metric mode labels lengths in centimeters; imperial mode labels them in inches. Switching the selector changes the interpretation of the entered numbers, not their numeric values. Convert both measurements beforehand if one was taken with a metric tape and the other came from an imperial drawing. Output is rounded to at most six decimal places, which is usually finer than the underlying field measurement warrants.
Worked example
Example 1: check a small rectangular frame
The perpendicular edges of a frame opening measure 3 centimeters and 4 centimeters. Select hypotenuse mode and metric units, then enter 3 and 4. Squaring gives 9 and 16; their sum is 25, whose square root is 5 cm. This is the expected diagonal if the two measured edges meet at a right angle.
Example 2: recover the other leg
A right-triangle detail has a known leg of 5 inches and a hypotenuse of 13 inches. Select missing-leg mode and imperial units. Enter 5 in the first field and 13 in the second. The difference of squares is 169 − 25 = 144, so the missing side is 12 in. Entering 13 first and 5 second should produce a validation error, not a negative or imaginary construction dimension.
Expert tips
Common mistakes
- Adding side lengths measures the route along the edges, not the diagonal. Walking along two edges follows a different path from the straight segment joining their endpoints.
- Subtracting lengths before taking a square root leaves out the essential squaring step. Missing-leg mode subtracts squared lengths; the square operation is essential to the theorem.
- A geometric length is not an engineering capacity assessment. Knowing a brace length says nothing about its strength, connection design, buckling behavior, or suitability for an occupied structure.
Frequently asked questions
Can it solve a triangle without a right angle?
No. For a general triangle, use the triangle calculator and provide an appropriate set of sides or angles rather than imposing a right-angle assumption.
Which side is always longest?
The hypotenuse is longer than either leg in a nondegenerate right triangle. It lies opposite the ninety-degree angle, regardless of how the drawing is rotated.
Can the lengths be decimals?
Yes. Positive finite decimal lengths are accepted. Use the same unit for both measurements, and keep enough digits to represent the actual measurement rather than an early rounded estimate.
Does the unit selector convert my measurements?
No. It changes the output unit label and the interpretation of the inputs. Replace the numeric entries yourself when switching between centimeters and inches.
Why is a zero side invalid?
A side of zero would not form a triangle with positive area. This tool therefore requires positive lengths and rejects a hypotenuse equal to the known leg.
Related calculators
Related guides
MathPercentages people get wrong: change, difference and pointsThe denominator determines the answer. Learn to distinguish percentage change, symmetric difference and percentage-point movements.14 November 2026 · 7 min read
MathStandard deviation without the jargonThe average tells you the centre. Standard deviation helps describe the spread, provided you know what the data represents.14 November 2026 · 7 min readSources and standards
About the author
Dr. Hassan Khames Eliwa holds a PhD in Construction & Built Environment and has more than 20 years of international project controls experience. He is Director of Eliwa Project Controls Limited in Auckland and founder of PMMilestone.org and PMMilestone.com.
Buy me a coffee