Pythagorean Theorem Calculator
Enter any two sides of a right triangle and the calculator returns the third using a^2 + b^2 = c^2. It handles both directions — giving the hypotenuse from the two legs, or one leg when you know the hypotenuse and the other leg. As a bonus it returns the triangle’s interior angles in degrees and radians, useful for any framing, layout or trig homework.
How the calculation works
-
1
Pick what to solve for
Hypotenuse (c) from legs a and b, or a leg (a or b) from the hypotenuse and the other leg.
-
2
Enter two sides
Any positive real numbers. Mixed units are your problem — make sure both sides use the same unit.
-
3
Apply the theorem
c = sqrt(a^2 + b^2), or a = sqrt(c^2 - b^2).
-
4
Read the result
Third side, plus angle opposite each side (90° is always between the two legs).
Common Pythagorean triples
Integer side lengths that satisfy a^2 + b^2 = c^2:
| a | b | c |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 8 | 15 | 17 |
| 7 | 24 | 25 |
| 20 | 21 | 29 |
| 9 | 40 | 41 |
Multiples of any triple are also triples: 6-8-10, 9-12-15, and so on. Framers use 3-4-5 (in feet or inches) to square a corner on a building site — if one side is 3, another is 4, and the diagonal measures exactly 5, the corner is 90°.
When the theorem applies
- Right triangles only. If none of the angles is 90°, use the law of cosines (c^2 = a^2 + b^2 - 2ab·cos C).
- Flat (Euclidean) space. The theorem holds on a plane. On a sphere (earth surface over long distances), it does not.
- Straight-line distance. You are measuring a single straight segment, not a path along two sides.
Practical uses
- Carpentry and framing. 3-4-5 method to square walls and corners.
- Screen and monitor diagonals. A 27“ diagonal on a 16:9 monitor is
diag = sqrt(w^2 + h^2); given the diagonal, solve back for w and h. - Ladder safety. The 4:1 rule for ladders becomes a Pythagoras problem — a 12-foot ladder with the base 3 feet out reaches sqrt(144 - 9) ≈ 11.6 feet up.
- GIS at short distances. The “planar approximation” to great-circle distance: fine over a few kilometres, wrong over hundreds.
Extending to 3D
For a rectangular box with sides a, b, c, the space diagonal is sqrt(a^2 + b^2 + c^2). The formula follows from applying Pythagoras twice: first to the base diagonal, then to that diagonal and the vertical side.
Frequently Asked Questions
Only right triangles (one 90° angle). For other triangles use the law of cosines, which generalises Pythagoras for any angle between the two known sides.
It is the smallest Pythagorean triple with integer sides. Framers and builders use it to square corners on-site because the measurements are easy to lay out with a tape.
Yes. The theorem works on any positive real numbers, not just integers. Most real-world measurements produce decimal outputs.
Negative side lengths do not have a physical meaning. The calculator refuses them; if you typed a minus by mistake, remove it.
Not reliably. Earth is a sphere; a flat-distance Pythagoras calculation over hundreds of kilometres is wrong by several percent. Use haversine or Vincenty for geodesic distance.
Related Tools
Age Calculator
Calculate exact age in years, months and days from a birth date, plus total days, hours and the next birthday countdown.
BMI Calculator
Calculate body mass index from height and weight. Shows WHO category, healthy-weight range and limitations of BMI.
BMR Calculator
Estimate your basal metabolic rate — the calories you burn at complete rest. Uses the Mifflin-St Jeor equation, the current clinical standard.
Calorie Calculator
Estimate daily calorie needs for your goal using Mifflin-St Jeor BMR and activity factors. Includes deficit and surplus targets.
CD Calculator
Calculate the interest and final balance on a Certificate of Deposit. Handles compounding frequency and early withdrawal penalties.
Concrete Calculator
Calculate how much concrete you need for slabs, footings, columns and walls. Get cubic yards, bag counts and material cost estimates.