Pythagorean Theorem Calculator
Choose the side you want to find and enter the other two. The answer, the working and a diagram of your triangle update as you type.
Triangle sides
Any unit works (cm, m, in, ft) as long as both sides use the same one. Up to 6 decimal places.
Step by step
How to use the Pythagorean theorem calculator
Pick the side you are looking for: one of the two legs (a or b, the sides that meet at the right angle) or the hypotenuse (c, the longest side, opposite the right angle). Enter the two sides you know. You get the missing side as an exact value in simplest radical form, its decimal value, every step of the working, and the triangle's area, perimeter and angles.
The formula
For any right triangle, a² + b² = c². Rearranged for each side:
- Hypotenuse: c = √(a² + b²)
- Leg a: a = √(c² − b²)
- Leg b: b = √(c² − a²)
When the number under the root isn't a perfect square, the answer is simplified by taking out square factors: √50 = √(25 × 2) = 5√2. The hypotenuse is always longer than either leg, so a leg can only be found when c is the larger number.
Worked example
A ramp rises 6 ft over a run of 9 ft. How long is the ramp? c² = 6² + 9² = 36 + 81 = 117. The largest square factor of 117 is 9, so c = √117 = √(9 × 13) = 3√13 ≈ 10.82 ft. The triangle's area is 6 × 9 ÷ 2 = 27 sq ft and its perimeter is 15 + 3√13 ≈ 25.82 ft.
FAQ
What is a Pythagorean triple?
Three whole numbers that fit a² + b² = c², such as 3-4-5, 5-12-13, 8-15-17 and 7-24-25. Any multiple of a triple is also one, so 6-8-10 works too. The calculator tells you when your sides form a triple.
Does the theorem work for triangles without a right angle?
No. For other triangles use the law of cosines, c² = a² + b² − 2ab·cos(C), which becomes the Pythagorean theorem when C is 90°. The theorem also works in reverse: if a² + b² = c², the triangle has a right angle.
Why is my answer shown with a square root?
Most square roots are irrational, so any decimal is rounded. The radical form (like 3√13) is the exact value, which is what teachers usually ask for. The decimal is shown alongside it for measuring.
Is anything I enter sent anywhere?
No. CalculatorFly works it out in your browser with WebAssembly; nothing is uploaded or stored.