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.
Formula
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 a | Leg b | Hyp c | Check (a^2 + b^2) | Angle alpha | Angle beta |
|---|---|---|---|---|---|
| 3 | 4 | 5 | 9 + 16 = 25 | 36.87 deg | 53.13 deg |
| 5 | 12 | 13 | 25 + 144 = 169 | 22.62 deg | 67.38 deg |
| 8 | 15 | 17 | 64 + 225 = 289 | 28.07 deg | 61.93 deg |
| 7 | 24 | 25 | 49 + 576 = 625 | 16.26 deg | 73.74 deg |
| 20 | 21 | 29 | 400 + 441 = 841 | 43.60 deg | 46.40 deg |
| 9 | 40 | 41 | 81 + 1600 = 1681 | 12.68 deg | 77.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.