Right Triangle Calculator

Enter any two values (at least one of them a side) and get every side and angle of the right triangle, plus its area and perimeter.

Right Triangle Calculator

Solve a right triangle from any two values: missing sides, angles, area and perimeter.

Opposite side a.

Opposite side b.

Results

Hypotenuse c

5

Side a
3
Side b
4
Side c
5
Angle A
36.8699°
Angle B
53.1301°
Area
6
Perimeter
12
Height to hypotenuse
2.4

Diagram

a = 3 b = 4 c = 5 A = 36.87° B = 53.13°
Drawn to scale. The right angle (C) is at the bottom left.

How to use the right triangle calculator

  1. Enter exactly two of the five values: legs a and b, hypotenuse c, and acute angles A and B (in degrees). Leave the others blank.
  2. At least one value must be a side length. Angle A is opposite side a; angle B is opposite side b.
  3. Read the results and the to-scale diagram. Units are whatever you used for the sides.

How the calculation works

In a right triangle the two acute angles add to 90°, and the sides satisfy the Pythagorean theorem a² + b² = c². With two legs, the hypotenuse is √(a² + b²). With a leg and the hypotenuse, the other leg is √(c² − a²). With a side and an angle, the trigonometric ratios sin A = a/c, cos A = b/c and tan A = a/b give the rest.

The calculator rejects impossible inputs: a leg that is equal to or longer than the hypotenuse, angles of 90° or more, or two angles without a side.

Formula

Pythagorean theorem
c = √(a² + b²)
Trigonometric ratios
sin A = a/c   cos A = b/c   tan A = a/b
Area and perimeter
Area = ½ab    P = a + b + c

Worked examples

Legs 3 and 4

c = √(9 + 16) = 5. A = arctan(3/4) = 36.87°, B = 53.13°. Area = 6, perimeter = 12.

Hypotenuse 10, angle A = 30°

a = 10 × sin 30° = 5; b = 10 × cos 30° = 8.660254; B = 60°.

Assumptions and limitations

  • Only right triangles. For other triangles use the law of sines or cosines.
  • Results are shown to six significant decimals; irrational results such as √2 are approximations.

Frequently asked questions

How do I find the hypotenuse?

Square both legs, add them, and take the square root: c = √(a² + b²).

Can I solve a right triangle with only two angles?

No. Two angles fix the shape but not the size, since infinitely many similar triangles share them. You need at least one side length.

Why does it say my triangle is impossible?

The hypotenuse is always the longest side. If a leg is equal to or longer than the hypotenuse, no right triangle exists.

Formulas last reviewed . Read our calculation methodology or report a problem.

All math calculators
Construction

Rafter Calculator

Rafter length, rise, roof angle and cut angles from span or run and pitch, with overhang.