Pythagorean Theorem Calculator
Find the hypotenuse or a missing leg of any right triangle from a² + b² = c².
Detects Pythagorean triples and tests whether three sides form a right angle.
The Pythagorean theorem is the most famous formula in geometry. It applies to any right triangle (a triangle with exactly one 90° angle) and gives the relationship between the three side lengths.
The formula: a² + b² = c²
Where a and b are the two legs (the sides meeting at the right angle) and c is the hypotenuse (the side opposite the right angle, which is always the longest).
Rearranged forms:
- Find the hypotenuse: c = √(a² + b²)
- Find a leg: a = √(c² − b²) or b = √(c² − a²)
The ancient trick that still works on construction sites: A rope or tape measure cut into a 3-4-5 ratio forms a perfect right angle. Stretch 3 units along one wall, 4 units along the other, and if the diagonal measures exactly 5 units, the corner is square. Carpenters and surveyors have been using this since before formal geometry existed.
Pythagorean triples are sets of three positive integers (a, b, c) that satisfy a² + b² = c². The classic ones:
- 3, 4, 5 → 9 + 16 = 25 ✓
- 5, 12, 13 → 25 + 144 = 169 ✓
- 8, 15, 17 → 64 + 225 = 289 ✓
- 7, 24, 25 → 49 + 576 = 625 ✓
- 9, 40, 41 → 81 + 1,600 = 1,681 ✓
- 20, 21, 29
- 12, 35, 37
Any whole-number multiple of a triple is also a triple. 6-8-10, 9-12-15, and 30-40-50 all derive from 3-4-5.
The converse is just as useful: if a triangle’s sides satisfy a² + b² = c², then the angle opposite c must be exactly 90°. Construction inspectors use this to verify framing. Out-of-square corners cause cabinets to bind, doors to stick, and floors to slope.
Worked example, a ladder problem: A 13 ft ladder rests against a wall with its base 5 ft from the wall. How high up does the ladder reach?
The ladder is the hypotenuse (c = 13). The base distance is one leg (b = 5). The height is the other leg (a):
a² = c² − b² = 169 − 25 = 144 a = 12 ft
Worked example, diagonal distance: You want to know the straight-line distance between two points on a coordinate plane: (1, 2) and (4, 6).
The horizontal separation is 3 (= 4 − 1) and the vertical separation is 4 (= 6 − 2). These form the legs of a right triangle whose hypotenuse is the diagonal you want:
d = √(3² + 4²) = √25 = 5 units
This is exactly the distance formula. It is the Pythagorean theorem dressed up for coordinate geometry.
In 3D: The theorem extends naturally. The diagonal of a rectangular box with sides a, b, c is √(a² + b² + c²). This shows up in physics (vector magnitudes), graphics (camera distance), navigation (3D position differences), and structural engineering (diagonal bracing).
When it does not apply: The Pythagorean theorem only works for right triangles. For any other triangle, use the Law of Cosines: c² = a² + b² − 2ab·cos(C), which reduces to a² + b² = c² when C = 90° (cos 90° = 0).
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.