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.

By Adzita Editorial Team · Updated 2026-11-03 · How we build and check our tools

Any length unit; use the same unit for every side.
The side opposite the right angle; it must be the longest.

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:

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.

abcCheck
3459 + 16 = 25
5121325 + 144 = 169
8151764 + 225 = 289
7242549 + 576 = 625
202129400 + 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

  1. 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.
  2. Mixing units. Convert all sides to the same unit first. Feet and inches entered together give a wrong result.
  3. Forgetting the square root. The sum a² + b² is c², not c.
  4. 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 theLeg a (from leg b and hypotenuse c)
Leg b12
Hypotenuse c13

Result

a = 5

Right triangle with legs 5 and 12 and hypotenuse 13.

Leg a5
Leg b12
Hypotenuse c13
Workinga = √(c² − b²) = √(169 − 144) = √25
Area (½ × a × b)30
Perimeter30
Angle opposite a22.619865°
Angle opposite b67.380135°
Height to the hypotenuse (a × b ÷ c)4.615385
Whole-number (Pythagorean) tripleYes: 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.

Triangle CalculatorSolve triangles from SSS, SAS or ASA/AAS and get angles, area, perimeter, inradius and type.Square Root CalculatorSquare, cube and nth roots with simplified radical form and perfect-power check.Quadratic Formula CalculatorSolve ax² + bx + c = 0: real or complex roots, discriminant, vertex, axis and factored form.Distance CalculatorStraight-line distance between two points in 2D or 3D, with working and taxicab distance.

References and sources

  1. Euclid, Elements Book I, Proposition 47: the classical proof of the theorem, and Proposition 48 for its converse.
  2. Stewart, J., Precalculus: Mathematics for Calculus, for right-triangle trigonometry.

Check primary sources for anything you rely on.