Pythagorean theorem calculator
Calculate the hypotenuse or a leg of a right triangle using the Pythagorean theorem.
Calculations are based on Estonia's tax rates in force for 2026. Results are informational.
Last updated: 2026-06-03
What is the Pythagorean theorem?
In a right triangle the square of the hypotenuse equals the sum of the squares of the legs: a² + b² = c². The hypotenuse c = √(a² + b²); a leg b = √(c² − a²).
How it is calculated
Formula
in a right triangle a² + b² = c². Hypotenuse c = √(a² + b²); leg b = √(c² − a²).
Example
Legs 3 and 4 → hypotenuse √(9 + 16) = 5.
School problems step by step
Every Pythagoras problem starts the same way: identify the hypotenuse. It is opposite the right angle and always the longest side. Only then decide whether to add or subtract.
- Legs 6 and 8: c² = 6² + 8² = 36 + 64 = 100, so c = √100 = 10.
- Hypotenuse 13, leg 5: b² = 13² - 5² = 169 - 25 = 144, so b = 12.
- Legs 2 and 3: c² = 4 + 9 = 13, c = √13 ≈ 3.6056. The answer need not be a whole number.
- Distance between points (1, 2) and (7, 10): the differences are 6 and 8, distance √(36 + 64) = 10.
The builder's 3-4-5 rule for square corners
The theorem also works in reverse: if three sides satisfy a² + b² = c², the triangle is definitely right-angled. That is the basis of an old builder's trick. From a corner, measure 3 m along one wall and 4 m along the other and mark both points. If they are exactly 5 m apart, the corner is 90°.
For a small corner such as a cabinet use 30, 40 and 50 cm; for a large foundation use 6, 8 and 10 m. Longer sides reduce the effect of measuring errors. Other whole-number triples are 5-12-13, 8-15-17 and 7-24-25 (49 + 576 = 625).
A 6 × 8 m rectangular foundation can also be checked by its diagonals: both must be 10 m. If one diagonal is 10.05 m and the other 9.95 m, the formwork is skewed and needs shifting until the diagonals match.
A ladder against a wall and a roof rafter
The rule of thumb for a safe ladder angle is 1:4: the foot stands about a quarter of the ladder's length away from the wall. For a 5 m ladder that is 1.25 m. How high does it reach? The ladder is the hypotenuse, so choose the leg mode: √(5² - 1.25²) = √(25 - 1.5625) = √23.4375 ≈ 4.84 m.
Rafter length: the house is 8 m wide and the ridge is 2.5 m above the top of the walls. The right triangle spans half the width, so the legs are 4 m and 2.5 m. The rafter is √(16 + 6.25) = √22.25 ≈ 4.72 m. Any eaves overhang is added on top.
Diagonals in everyday life
A 4.2 × 3.6 m floor has a diagonal of √(17.64 + 12.96) = √30.6 ≈ 5.53 m. That tells you whether a long table or rug fits corner to corner.
A TV's size in inches is its screen diagonal. A 55-inch 16:9 TV: diagonal 55 × 2.54 = 139.7 cm. The aspect ratio's diagonal is √(16² + 9²) = √337 ≈ 18.36 parts, so one part is 139.7 ÷ 18.36 ≈ 7.61 cm. Width is 16 × 7.61 ≈ 121.8 cm and height 9 × 7.61 ≈ 68.5 cm.
In three dimensions you apply the theorem twice. Will a 2.5 m pipe fit in a 2 × 1.2 × 1 m box? The floor diagonal squared is 4 + 1.44 = 5.44, the space diagonal √(5.44 + 1) = √6.44 ≈ 2.54 m. It fits if laid from one corner to the opposite one.
Common mistakes
Most wrong answers come from one of the slips below. A quick sanity check: the hypotenuse must always come out longer than either leg.
- Squaring the sum instead of summing the squares: (3 + 4)² = 49, but the correct 3² + 4² = 25.
- In hypotenuse mode you enter two legs; in leg mode the first field is the hypotenuse. If it is shorter than the leg, the calculator shows 0.
- The theorem does not hold in a triangle without a right angle. For other triangles use the law of cosines.
- Mixed units: convert 1.25 m and 500 cm to the same unit before calculating.
Frequently asked questions
What is the Pythagorean theorem?+
In a right triangle a² + b² = c², where c is the hypotenuse and a, b are the legs.
How do I find a leg?+
If you know the hypotenuse c and one leg a, the other leg is √(c² − a²).