Pythagorean Theorem CalculatorFree online math calculator — instant results, no sign-up
Find the missing side: a² + b² = c². Leave the unknown as 0.
Sign in to save results and favorites.
About the Pythagorean Theorem Calculator
The Pythagorean Theorem Calculator determines the length of an unknown side in a right-angled triangle using the relationship a² + b² = c². It solves for either the hypotenuse or one of the legs when the other two sides are known. Students, carpenters, engineers, and designers use it for quick geometric and layout measurements.
- a
- Length of the first leg of the right triangle; enter 0 if this is the unknown side (positive real number).
- b
- Length of the second leg of the right triangle; enter 0 if this is the unknown side (positive real number).
- c
- Length of the hypotenuse (the side opposite the 90-degree right angle); enter 0 if this is the unknown side (positive real number).
Formula and method
If c is 0: c = √(a² + b²) If a is 0: a = √(c² - b²) If b is 0 (or neither c nor a is 0): b = √(c² - a²)
- aLength of leg a
- bLength of leg b
- cLength of the hypotenuse c
The tool checks which input is set to 0. If hypotenuse c is 0, it computes the Euclidean norm √(a² + b²); if leg a is 0, it subtracts b² from c² and takes the square root; otherwise, it computes √(c² - a²). The result is rounded to 6 decimal places.
Worked example
These are the calculator's starting values and the results it actually produces for them.
Inputs
- a3
- b4
- c0
Results
- Missing side5
How to use the Pythagorean Theorem Calculator
- 1Identify which side of the right triangle is unknown: leg a, leg b, or hypotenuse c.
- 2Enter the known side measurements into their respective fields using identical units.
- 3Set the unknown side's input field to 0.
- 4Read the calculated missing side length output.
Reading your result
The result represents the exact linear length of the missing side in the same units used for the input values. For a valid right triangle, the hypotenuse c must always be strictly greater than either individual leg a or b.
Limitations
This calculator applies strictly to flat two-dimensional Euclidean right triangles with a 90-degree angle; it does not work for oblique triangles (which require the Law of Cosines). If the provided hypotenuse is smaller than an entered leg, the square root operation results in NaN.
Common questions
What happens if I enter values for all three sides?+
Because the code checks c first, then a, providing non-zero values for all three fields causes the calculator to treat b as the unknown and recompute b as √(c² - a²).
Does the calculator require specific units like inches or meters?+
No specific unit is required, but all side lengths must share the same unit of measurement (such as all millimeters, all feet, or all meters).
Why does the result show 'NaN'?+
'NaN' (Not a Number) appears when solving for a leg if the hypotenuse c is smaller than or equal to the given leg, resulting in taking the square root of a negative number.
Does the calculator save my information?+
Calculations run in your browser. While signed in, inputs and results are automatically recorded in account history; saving a result creates a separate saved record.
Further reading
You might also like
Slope Calculator
Slope, angle and line equation through two points.
Area Calculator
Area of common 2D shapes.
Volume Calculator
Volume of common 3D shapes.
Surface Area Calculator
Surface area of 3D shapes.
Circle Calculator
Radius, diameter, circumference and area.
Triangle Calculator
Solve a triangle from three sides.
Results are estimates for informational purposes and are not financial, medical or legal advice.