Free Online Pythagorean Theorem Calculator
Find a missing triangle side using the Pythagorean theorem.
Only a right triangle satisfies a² + b² = c². The hypotenuse is always the longest side and sits opposite the right angle.
Step-by-step working
- Enter two known sides to see the formula and substitution.
About the Pythagorean Theorem Calculator
The Pythagorean theorem relates the three sides of a right triangle: the square of the hypotenuse equals the sum of the squares of the other two sides. Written as a formula, a² + b² = c², where c is the longest side opposite the 90-degree angle. If you know any two sides, you can always find the third. This calculator solves for the hypotenuse or either leg, keeps your chosen unit, and shows the formula, substitution, area, and perimeter.
Solving for the hypotenuse
When both legs are known, add their squares and take the square root: c = √(a² + b²). A classic 3-4-5 triangle gives 9 + 16 = 25, so the hypotenuse is 5. The result is always longer than either leg. If the two legs are equal, the hypotenuse is the leg length multiplied by the square root of two, which is roughly 1.414 times the leg.
Solving for a missing leg
When the hypotenuse and one leg are known, rearrange the formula to subtract the known leg squared from the hypotenuse squared: a = √(c² − b²). The hypotenuse must be strictly longer than the known leg, otherwise the subtraction produces zero or a negative number and no real triangle exists. The calculator rejects that case instead of returning a misleading value.
Pythagorean triples
Some right triangles have three whole-number sides. The best known is 3-4-5, and any multiple of it, such as 6-8-10 or 15-20-25, is also valid. Other primitive triples include 5-12-13, 8-15-17, and 7-24-25. Builders, surveyors, and ancient Egyptian rope stretchers used these ratios to lay out a perfect right angle without a protractor. If your computed result is very close to a whole number but not exact, floating-point rounding is usually responsible; the displayed value is still correct to six decimal places.
Area and perimeter
The two legs are perpendicular, so either leg can be treated as the base and the other as the height. The area is therefore ½ × a × b. The perimeter is simply the sum of all three sides. Both values are reported in the selected unit, with area expressed in square units. These measurements are useful for estimating material, checking a framing square, or verifying a CAD drawing.
Why units are applied consistently
The theorem works only when both legs use the same unit. This tool applies one unit selector to every side so the arithmetic stays consistent. The area is then shown in that unit squared, and the perimeter in the plain unit. If you switch units, the numeric values are treated as the same number in the new unit rather than converted; the result is a direct re-labeling for convenience.
Frequently asked questions
Can the hypotenuse be shorter than a leg?
No. The hypotenuse is opposite the right angle and is always the longest side. If an input produces a hypotenuse shorter than a leg, the sides cannot form a right triangle.
Does this work for non-right triangles?
No. The Pythagorean theorem applies only to right triangles. For other triangles you need the law of cosines, which is available in the triangle calculator.
Why is my answer a decimal?
Most right triangles do not have integer sides. The square root of a non-perfect square is irrational, so the result is rounded to six decimal places for display.