How this calculator works
This calculator applies the Pythagorean theorem to a right triangle. Give it the two shorter sides (legs) to find the hypotenuse, or give it the hypotenuse plus one leg to find the other leg. Either way, it also returns the triangle's perimeter and area.
The theorem only applies to right triangles, where one angle is exactly 90 degrees. The hypotenuse is always the longest side, opposite the right angle, which is why solving for a missing leg requires the hypotenuse to be strictly longer than the leg you already know — otherwise no real right triangle exists with those measurements.
How do you calculate the hypotenuse with the Pythagorean theorem?
a² + b² = c², where a and b are the legs and c is the hypotenuseSolving for the hypotenuse: c = √(a² + b²)Solving for a leg: a = √(c² − b²)Area of a right triangle: (leg₁ × leg₂) ÷ 2Worked example: legs of 5 and 12
- Square both legs: 5² = 25 and 12² = 144.
- Add them: 25 + 144 = 169.
- Take the square root: c = √169 = 13.
- Perimeter = 5 + 12 + 13 = 30; area = (5 × 12) ÷ 2 = 30.
Frequently asked questions
Does the Pythagorean theorem work for any triangle?
No, only for right triangles. For other triangles, use the law of cosines, c² = a² + b² − 2ab·cos(C), which reduces to the Pythagorean theorem when the angle C is 90 degrees and cos(90°) = 0.
What are the most common Pythagorean triples?
3-4-5 and 5-12-13 are the best known integer solutions, along with their multiples like 6-8-10 and 9-12-15. Any set of three positive integers satisfying a² + b² = c² is called a Pythagorean triple.
Why does solving for a leg require the hypotenuse to be larger?
Because c² − b² must be positive to take a real square root. If the given leg were equal to or longer than the hypotenuse, the triangle could not close with a 90-degree angle, so the calculator returns no result in that case.
Can I use this for distances, not just triangle sides?
Yes. The theorem is the basis for the distance formula between two points on a plane: distance = √((x₂−x₁)² + (y₂−y₁)²), which is exactly the hypotenuse of the right triangle formed by the horizontal and vertical differences.
How do I check if three side lengths form a right triangle?
Square the two shorter sides, add them together, and compare the sum to the square of the longest side; if they match, it's a right triangle. For the classic 3-4-5 triangle, 3² + 4² = 9 + 16 = 25, and 5² = 25 — the two match, confirming a right triangle.