Pythagorean Theorem Calculator
Calculate the hypotenuse or a leg of a right triangle. The simulator updates in real time as you enter values.
The Pythagorean theorem is one of the foundations of Euclidean geometry and one of the most widely known and applied mathematical concepts. It states that in a right triangle, the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the other two sides (legs): a² + b² = c². This relationship has thousands of applications in architecture, engineering, surveying and physics.
This calculator lets you calculate the hypotenuse knowing both legs, or calculate a leg when you know the hypotenuse and the other leg. The visual simulator updates in real time so you can see the right triangle with the correct proportions. Particularly useful for secondary school and vocational training problems or construction work.
Enter values to calculate.
How to apply the theorem step by step
The theorem relates the three sides of a right triangle through the formula a² + b² = c², where c is always the hypotenuse (the side opposite the right angle). To find the hypotenuse you square both legs, add them and take the square root of the total. To find a leg you do the opposite: subtract the square of the known leg from the square of the hypotenuse and take the root. The key is to correctly identify which side is the hypotenuse before you start.
Worked example
Take a right triangle with legs of 6 and 8 units. Applying the formula: c = √(6² + 8²) = √(36 + 64) = √100 = 10. The hypotenuse is 10 units. If instead we knew the hypotenuse (10) and one leg (6), the other leg would be √(10² − 6²) = √(100 − 36) = √64 = 8.
Most common Pythagorean triples
| Leg a | Leg b | Hypotenuse c |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 8 | 15 | 17 |
| 7 | 24 | 25 |
| 20 | 21 | 29 |
| 9 | 40 | 41 |
How to interpret the result
The result shown by the calculator is mathematically exact, but it will often have decimals because most triangles do not form perfect Pythagorean triples. In a classroom problem you are usually asked to round to two decimal places; in construction or carpentry it is enough to round to the unit of measurement you are using (millimetres or centimetres). Remember that the three sides must share the same units: if the legs are in metres, the hypotenuse will also come out in metres.
Three real problems solved
A ladder against a wall: if it is 5 m long and you place the base 1.5 m from the wall, the height it reaches is √(5² − 1.5²) = √(25 − 2.25) = √22.75 ≈ 4.77 m. This is the calculation firefighters and painters make, and it also tells you whether the angle is safe, because a ladder that is too vertical tips backwards. The television: a TV's inches measure the diagonal, not the width. A 16:9 panel 120 cm wide and 67.5 cm high has a diagonal of √(120² + 67.5²) ≈ 137.7 cm, that is about 54 inches. This is why two TVs with the same inches but different proportions take up different widths. Squaring a room: measure 3 m along one wall, 4 m along the other, and check that the distance between those two points is exactly 5 m. If it is, the corner is a perfect right angle. It is the old 3-4-5 trick builders have used for centuries, and it needs no tool beyond a tape measure.
When the theorem cannot be applied
The theorem only works in right triangles, that is, those with an angle of exactly 90 degrees, and on a flat surface. If the triangle has no right angle, the correct relation is the law of cosines, which adds a correction term: c² = a² + b² − 2ab·cos(C). When angle C is 90 degrees its cosine is zero, the term vanishes and Pythagoras is recovered, turning out to be a particular case. Nor does it apply as such on curved surfaces: in spherical geometry, used for navigation or for distances over the Earth, a triangle's angles add up to more than 180 degrees and distances follow other formulas. And a practical detail: always check that the side you call the hypotenuse is the longest one, because confusing it with a leg is the most common mistake when setting up the problem.
Results are mathematically exact. Round to the number of decimal places you need for your practical application.
Frequently asked questions
Related calculator: Unit converter