Right Triangle Calculator
Calculate the hypotenuse, area, and angles of a right triangle from its two legs (the two sides that meet at the right angle). Enter both leg lengths to instantly get the hypotenuse via the Pythagorean theorem, the triangle's area, and its acute angles.
- Area
- 6 m²
- Angle A
- 36.87 °
- Angle B
- 53.13 °
- Perimeter
- 12 m
Legs are the two sides forming the 90° angle; the hypotenuse is the longest side opposite it. Use consistent length units for both legs (e.g. meters); the area will be in those units squared. Angles are reported in degrees.
What the Right Triangle Calculator Does
This right triangle calculator takes the two legs of a right triangle, the sides that meet at the 90 degree corner, and instantly returns the hypotenuse, the area, and the two non-right angles. A right triangle is any triangle with one angle equal to exactly 90 degrees.
It is built for students checking geometry and trigonometry homework, DIY builders squaring a deck or framing a wall, surveyors, and anyone who knows two sides and needs the rest. Enter leg a and leg b, and the calculator handles the math so you can focus on the result.
How It Works: The Formulas
Three standard formulas drive the calculator. The legs are labeled a and b, the hypotenuse is c, and the angles opposite a and b are A and B.
Once both legs are known, every other value follows directly. No iteration or guessing is needed.
- Hypotenuse: c = hypot(a, b) = square root of (a squared + b squared). This is the Pythagorean theorem, a^2 + b^2 = c^2, solved for c.
- Area: area = (a x b) / 2. The two legs act as base and height because they are perpendicular.
- Angles: A = atan2(a, b) and B = atan2(b, a), converted from radians to degrees. The atan2 function is the tangent ratio (opposite over adjacent) and reliably handles the full range of inputs.
Worked Example With Real Numbers
Suppose leg a = 3 and leg b = 4.
Hypotenuse: c = square root of (3^2 + 4^2) = square root of (9 + 16) = square root of 25 = 5. This is the classic 3-4-5 triangle.
Area: (3 x 4) / 2 = 12 / 2 = 6 square units.
Angles: A = atan2(3, 4) is about 36.87 degrees, and B = atan2(4, 3) is about 53.13 degrees. As a check, 36.87 + 53.13 + 90 = 180 degrees, which is exactly what the three angles of any triangle must sum to.
Tips and Common Mistakes
A few habits keep your results accurate and meaningful.
- Use the same unit for both legs. If a is in feet and b is in inches, convert first or the hypotenuse and area will be wrong.
- Area carries squared units. If your legs are in centimeters, the area is in square centimeters, not centimeters.
- The hypotenuse is always the longest side and always opposite the 90 degree angle. If a result looks shorter than a leg, you have likely entered the hypotenuse as a leg.
- Avoid rounding mid-calculation. Rounding the hypotenuse before computing angles introduces small errors; keep full precision until the final answer.
- Check the angle sum. The two computed angles should add to 90 degrees, since the third angle takes up the remaining 90 of the 180 degree total.
Factors That Affect the Result
The output depends entirely on the accuracy of your two leg measurements. A small error in a leg grows when squared, so a sloppy measurement can noticeably shift both the hypotenuse and the angles.
Remember that this tool assumes a true right triangle. If your real-world corner is not exactly 90 degrees, the Pythagorean result will not match a physical diagonal measurement. For non-right triangles, use the law of cosines or law of sines instead.
Frequently asked questions
What is the hypotenuse formula?
By the Pythagorean theorem, the hypotenuse equals the square root of the sum of the squares of the two legs: c = sqrt(a² + b²). This calculator uses hypot(legA, legB), which computes the same value accurately.
How is the area of a right triangle found?
The two legs are perpendicular, so they act as the base and height. The area is simply (legA × legB) / 2.
How are the angles calculated?
Angle A (opposite leg A) is atan2(legA, legB) converted to degrees, and angle B is its complement. The two acute angles always add up to 90°.
What units does it use?
Enter both legs in the same length unit (meters by default). The hypotenuse and perimeter share that unit, the area is in that unit squared, and angles are in degrees.