Home / Math / Pythagorean Theorem Calculator
Pythagorean Theorem Calculator
Pick which side you need, enter the two sides you know, and get the missing side of a right triangle with its area, perimeter, both acute angles and a check for whole-number triples.
The theorem and its three forms
In any right triangle the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c². The hypotenuse c is the side opposite the right angle, and it is always the longest. Rearranging gives the three forms used here:
- Hypotenuse:
c = √(a² + b²) - Leg a:
a = √(c² − b²) - Leg b:
b = √(c² − a²)
The first form adds two squares, so any positive legs work. The other two subtract, which is why the hypotenuse you enter must exceed the leg. If it does not, no real right triangle exists and the page reports an error.
Whole-number triples
Some right triangles have three whole-number sides. These are called Pythagorean triples, and the page marks your result when all three sides are integers. Multiplying every side of a triple by the same number gives another triple, so 3-4-5 leads to 6-8-10 and 9-12-15.
| a | b | c | Check |
|---|---|---|---|
| 3 | 4 | 5 | 9 + 16 = 25 |
| 5 | 12 | 13 | 25 + 144 = 169 |
| 8 | 15 | 17 | 64 + 225 = 289 |
| 7 | 24 | 25 | 49 + 576 = 625 |
| 20 | 21 | 29 | 400 + 441 = 841 |
Where the theorem is used
Builders use it to check that a corner is square: measure 3 along one edge and 4 along the other, and the diagonal should be exactly 5 in the same unit. Surveyors and designers use it for straight-line distances, such as the diagonal of a rectangular room or screen, and for the length of a ladder or ramp against a vertical rise. In coordinate geometry the distance between two points is the same formula applied to the horizontal and vertical differences.
The angles shown come from the inverse tangent, A = atan(a ÷ b), and the other acute angle is 90° minus that. If you know an angle instead of two sides, use the triangle calculator.
Common mistakes and limits
- Using it on a triangle without a right angle. The theorem holds only when one angle is exactly 90°. Its converse is also true: if a² + b² = c² for the three sides, the triangle is right-angled.
- Mixing units. Convert all sides to the same unit first. Feet and inches entered together give a wrong result.
- Forgetting the square root. The sum a² + b² is c², not c.
- Putting the hypotenuse in a leg field. In the leg modes, c must be the largest value.
Results are shown to six decimal places, so irrational sides such as √2 are rounded. For square roots in exact form, see the square root calculator.
Worked example
A ladder of length 13 stands against a wall with its foot 12 away from the base. How high up the wall does it reach?
Inputs
| Find the | Leg a (from leg b and hypotenuse c) |
|---|---|
| Leg b | 12 |
| Hypotenuse c | 13 |
Result
Right triangle with legs 5 and 12 and hypotenuse 13.
| Leg a | 5 |
|---|---|
| Leg b | 12 |
| Hypotenuse c | 13 |
| Working | a = √(c² − b²) = √(169 − 144) = √25 |
| Area (½ × a × b) | 30 |
| Perimeter | 30 |
| Angle opposite a | 22.619865° |
| Angle opposite b | 67.380135° |
| Height to the hypotenuse (a × b ÷ c) | 4.615385 |
| Whole-number (Pythagorean) triple | Yes: 5, 12, 13 |
Accuracy note: Results use standard double-precision arithmetic, so very large or very small values may be rounded. Check important results by another method.
Frequently asked questions
What is the Pythagorean theorem?
It states that in a right triangle the square of the hypotenuse equals the sum of the squares of the two legs, written a² + b² = c². It only applies to triangles with a right angle.
How do I find a missing leg?
Subtract the square of the known leg from the square of the hypotenuse, then take the square root. For c = 13 and b = 12 that gives √(169 − 144) = 5.
Which side is the hypotenuse?
The hypotenuse is the side directly opposite the 90 degree angle, and it is always the longest side of the triangle. The other two sides are called legs.
What is a Pythagorean triple?
It is a set of three positive whole numbers that satisfy a² + b² = c², such as 3, 4, 5 or 5, 12, 13. Multiples of a triple are also triples.
Can I use this with any unit?
Yes, as long as every side uses the same unit. The area is then in that unit squared, and the angles do not depend on the unit at all.
Related calculators
References and sources
- Euclid, Elements Book I, Proposition 47: the classical proof of the theorem, and Proposition 48 for its converse.
- Stewart, J., Precalculus: Mathematics for Calculus, for right-triangle trigonometry.