Pythagorean Theorem Calculator
Last updated: 2026-05-09
Enter your email and download a PDF report with your results.
| Leg a | Leg b | |
|---|---|---|
| Caso basico | 1.2 | 1.6 |
| Caso tipico | 2.1 | 2.8 |
| Caso medio | 3.0 | 4.0 |
| Caso avanzado | 4.5 | 6.0 |
| Caso extremo | 7.5 | 10.0 |
What is the Pythagorean theorem?
The Pythagorean theorem states that in a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides (legs): a² + b² = c². It's one of the most fundamental theorems in geometry, attributed to the ancient Greek mathematician Pythagoras (though known in Babylonian mathematics more than 1,000 years earlier), with direct applications in construction, architecture, surveying, engineering, and physics.
This calculator solves for any one of the three sides given the other two. You can find the hypotenuse (c) from both legs, or find a missing leg (a or b) when you know the hypotenuse and the other leg — useful for checking diagonal cuts, verifying square corners, and calculating distances in coordinate geometry.
The three Pythagorean formulas
- Find the hypotenuse: c = √(a² + b²)
- Find leg a: a = √(c² − b²)
- Find leg b: b = √(c² − a²)
The hypotenuse is always the longest side — it must be greater than either leg. If your result produces an imaginary number (square root of a negative), your triangle dimensions are geometrically impossible: the two shorter sides cannot form a right triangle with the hypotenuse you specified.
Worked examples
Example 1 — Construction site square: A builder measures 3 m along one wall and 4 m along the adjacent wall. If the corner is truly 90°, the diagonal should be:
- c² = 3² + 4² = 9 + 16 = 25
- c = √25 = 5 m
This is the famous 3-4-5 Pythagorean triple. If your measured diagonal is exactly 5 m, the corner is square. Any deviation indicates an out-of-square corner.
Example 2 — Diagonal of a room: A room is 5.4 m long and 3.8 m wide. What's the diagonal distance (useful for planning furniture placement or running cable)?
- c² = 5.4² + 3.8² = 29.16 + 14.44 = 43.60
- c = √43.60 ≈ 6.60 m
Pythagorean triples
A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy a² + b² = c². They're useful because they give exact integer results:
- 3 – 4 – 5 (and multiples: 6-8-10, 9-12-15…)
- 5 – 12 – 13
- 8 – 15 – 17
- 7 – 24 – 25
- 20 – 21 – 29
In real-world applications, the legs and hypotenuse are rarely whole numbers, but the theorem works identically for any real-valued measurements — the calculator returns the exact result regardless.
Common applications
- Construction and carpentry: Checking right angles on site using the 3-4-5 method or any scaled version.
- Architecture and floor plans: Calculating diagonal dimensions of rooms, finding the actual length of a sloped rafter.
- Surveying and navigation: Computing straight-line distances between two points with known horizontal and vertical offsets.
- Physics: Resolving vector components — force, velocity, and displacement in two dimensions.
- Computer graphics: Finding the Euclidean distance between two pixels or screen coordinates.
- Stair design: The rise and run of a staircase form the two legs; the stringer length is the hypotenuse.
Common mistakes
- Using the formula on non-right triangles: The theorem only applies when one angle is exactly 90°. For other triangles, use the Law of Cosines instead.
- Squaring instead of finding the square root: The formula gives c² = a² + b², so you must take the square root at the end. Forgetting this final step is the most common arithmetic error.
- Confusing legs and hypotenuse: The hypotenuse is always opposite the right angle and always the longest side. If you label a shorter side as the hypotenuse, the result will be wrong.
Frequently asked questions
Yes — in three dimensions, the space diagonal of a rectangular box with sides a, b, c is d = √(a² + b² + c²), which is just the Pythagorean theorem applied twice. Similarly, the distance formula between two points in 3D space is the 3D extension of the Pythagorean theorem.
Use the 3-4-5 method: measure 3 units along one wall, 4 units along the adjacent wall, and check that the diagonal is exactly 5 units. Any consistent unit works (metres, feet, tiles). If the diagonal doesn't measure 5 units, the corner is not square and needs adjustment.
Yes. The calculator uses IEEE 754 double-precision arithmetic, which gives 15–17 significant decimal digits of accuracy. For practical construction and engineering purposes, the result is more than sufficiently precise.