Skip to content
Math

Pythagorean Theorem Calculator

The Pythagorean theorem describes the fixed relationship between the three sides of every right triangle, a relationship that holds without exception across Euclidean geometry and underpins distance calculations in engineering, architecture, and navigation. Enter any two of the three sides and this calculator solves for the third, then goes further: it computes both acute angles, the triangle area, the perimeter, and the altitude from the right angle to the hypotenuse.

Your details

All three sides must share the same unit. Area is returned in the same unit squared.
One of the two shorter sides that meet at the right angle. Leave blank to solve for it.
cm
The other side meeting at the right angle. Leave blank to solve for it.
cm
The longest side, opposite the right angle. Leave blank to solve for it. Must be larger than either leg.
cm
Missing side
Hypotenuse c = 5.0000 cm
Leg a3
Leg b4
Hypotenuse c5
Angle alpha (opposite a)36.87deg
Angle beta (opposite b)53.13deg
Area6
Perimeter12
Altitude to hypotenuse2.4
Leg a3
Leg b4
Hypotenuse c5

Hypotenuse c = 5.0000 cm

  • The three sides satisfy a + b + c = 12.000 and a squared plus b squared equals c squared exactly.
  • The two acute angles are alpha = 36.87 degrees (opposite leg a) and beta = 53.13 degrees (opposite leg b), which sum to 90 degrees as expected.
  • The altitude from the right angle to the hypotenuse is 2.4000, useful for computing projections, medians, and similarity ratios.
  • The hypotenuse is always the longest side, and the right angle is always between the two legs.

Next stepFill in any two sides and leave the third blank to solve for it. Switch the unit selector to work in feet, inches, metres, or any other length.

Formula

c=a2+b2,α=arcsin ⁣(ac),β=arcsin ⁣(bc),h=abcc = \sqrt{a^{2} + b^{2}}, \quad \alpha = \arcsin\!\left(\tfrac{a}{c}\right), \quad \beta = \arcsin\!\left(\tfrac{b}{c}\right), \quad h = \tfrac{ab}{c}

Worked example

Legs 3 cm and 4 cm: c = sqrt(9 + 16) = 5 cm. Alpha = arcsin(3/5) = 36.87 deg, beta = arcsin(4/5) = 53.13 deg. Area = 0.5 x 3 x 4 = 6 cm^2. Altitude = (3 x 4) / 5 = 2.4 cm.

How the Calculator Works

The calculator accepts three side fields, the two legs a and b plus the hypotenuse c, and asks you to fill in any two. If you leave the hypotenuse blank, it computes c as the square root of the sum of the squared legs. If you leave a leg blank, it rearranges the theorem to recover that leg from the square root of the hypotenuse squared minus the known leg squared. Once all three sides are known it reports both acute angles via the inverse-sine function, the area as half the product of the legs, the perimeter as the sum of all three sides, and the altitude from the right angle to the hypotenuse using the formula h = ab/c. Switch the unit selector before entering values to work in any length unit from millimetres to miles.

Solving for Angles

Once all three sides are established, both acute angles follow directly from the inverse-sine (arcsin) function. Angle alpha, opposite leg a, equals arcsin(a/c). Angle beta, opposite leg b, equals arcsin(b/c). The two always sum to exactly 90 degrees because the third angle of a right triangle is fixed at 90 degrees. These angles are useful for setting miter-saw cuts in carpentry, computing roof pitch in construction, and calculating bearing corrections in navigation. No separate input is needed: provide any two sides and the angles appear automatically.

The Altitude to the Hypotenuse

The altitude h dropped from the right-angle vertex perpendicular to the hypotenuse equals the product of the two legs divided by the hypotenuse, h = ab/c. This line creates two smaller triangles that are each similar to the original, a fact at the heart of several elegant geometric proofs. Practically, the altitude determines the height of a right-triangular object as seen from its longest edge, useful in roofing calculations, truss design, and optics.

Unit Switching

All eight common length units are available: millimetres, centimetres, metres, kilometres, inches, feet, yards, and miles. The conversion is applied consistently so you can, for example, enter room dimensions directly in feet without needing to convert first. The area output is in the selected unit squared. Make sure all three side inputs share the same unit before solving, the calculator does not mix units across fields.

Limitations

This calculator applies only to right triangles, triangles containing exactly one 90-degree angle. It does not handle oblique triangles, which require the law of cosines or the law of sines. It works exclusively in Euclidean (flat) geometry; on curved surfaces such as a sphere, the Pythagorean theorem does not hold and geodesic calculations are required instead. When solving for a leg, the hypotenuse you enter must exceed the known leg, since the hypotenuse is always the longest side. Extremely small or large values in unusual units (miles, for instance) may surface floating-point rounding, which the precision display mitigates.

Common Pythagorean Triples with Angles

Leg aLeg bHyp cCheck (a^2 + b^2)Angle alphaAngle beta
3459 + 16 = 2536.87 deg53.13 deg
5121325 + 144 = 16922.62 deg67.38 deg
8151764 + 225 = 28928.07 deg61.93 deg
7242549 + 576 = 62516.26 deg73.74 deg
202129400 + 441 = 84143.60 deg46.40 deg
9404181 + 1600 = 168112.68 deg77.32 deg

Whole-number right triangles where a squared plus b squared equals c squared exactly. Any multiple of a triple is also a triple. Angles are rounded to two decimal places.

Frequently asked questions

Can I find a missing leg instead of the hypotenuse?

Yes. Enter the hypotenuse c and one leg, then leave the other leg blank. The calculator solves for it using a = sqrt(c^2 - b^2), or b = sqrt(c^2 - a^2). The hypotenuse must be larger than the known leg you enter, otherwise no real right triangle exists and the result is left blank.

What are angles alpha and beta?

Alpha is the acute angle at the vertex opposite leg a, and beta is the acute angle opposite leg b. Both are computed using the inverse-sine function once all three sides are known: alpha = arcsin(a/c), beta = arcsin(b/c). They always sum to 90 degrees. The right angle itself (90 degrees) is between the two legs at the vertex where a and b meet.

What is the altitude to the hypotenuse?

The altitude h is the perpendicular distance from the right-angle vertex to the hypotenuse. It equals the product of the two legs divided by the hypotenuse: h = (a x b) / c. For the 3-4-5 triangle, h = (3 x 4) / 5 = 2.4. This line splits the original triangle into two smaller ones that are each similar to the original and to each other.

Which unit should I use?

Use whatever unit matches your measurement or problem. Choose the unit from the selector at the top, then enter all three side lengths in that unit. The calculator converts internally to metres to ensure accuracy regardless of the unit selected, then converts the result back for display. Mixing units across fields is not supported.

What are Pythagorean triples?

A Pythagorean triple is a set of three positive integers that exactly satisfy a^2 + b^2 = c^2, such as 3-4-5 or 5-12-13. Any integer multiple of a triple is also a triple: 6-8-10, 10-24-26, and so on. They arise naturally in tile patterns, screen resolutions, and structural engineering and are useful as quick-check benchmarks because the sides are whole numbers.

Sources

Written by Dr. Elena Vasquez, PhD Mathematician · Lisbon, Portugal

Translating rigorous geometric theory into accurate, reliable calculation tools trusted by engineers, students, and researchers worldwide.

Search 3,500+ calculators

Loading search…