a² + b² = c²
In a right triangle, the square on the longest side (the hypotenuse, opposite the right angle) equals the sum of the squares on the other two sides (the legs). If you know two sides, you can always find the third.
Worked examples
A ladder 4 m from a wall reaching 3 m up: c = √(3² + 4²) = √25 = 5 m long. A 13-foot ramp whose base runs 12 ft rises √(13² − 12²) = √25 = 5 ft.
Where it is used
Builders check corners are square with the 3-4-5 rule: measure 3 units along one wall and 4 along the other, and the diagonal must be exactly 5. TV and monitor sizes are diagonals: a 16:9 screen 120 cm wide and 67.5 cm tall has a diagonal of √(120² + 67.5²) ≈ 137.7 cm, about 54 inches. GPS and maps use the same formula for straight-line distances on a grid.
How this works
In hypotenuse mode the page computes c = √(a² + b²) with a routine that avoids overflow for very large or small values. In leg mode, the second input is the hypotenuse and the missing leg is √(c² − a²); the hypotenuse must be the longest side. The area is half the product of the two legs and the perimeter is the sum of all three sides, all in the same unit as your inputs. Results are rounded only for display. Everything runs in your browser.
Frequently asked
What is the hypotenuse?
The longest side of a right triangle, opposite the 90° angle.
Does the theorem work for any triangle?
Only right triangles. For others, use the law of cosines or the triangle calculator.
What is a Pythagorean triple?
Three whole numbers that satisfy a² + b² = c², such as 3-4-5, 5-12-13 and 8-15-17.
How do I check a corner is square?
Mark 3 and 4 units along the two sides; if the diagonal is 5, the angle is 90°.
Sources
Reviewed Oct 17, 2026 · test vectors fixtures/calculators/math/pythagorean-theorem-calculator/