Right Triangle Calculator

Enter any two values of a right triangle (sides or angles) and solve for all remaining properties. Angle C is always 90°, and angles are entered in degrees.

Two Known Values

Select what each value represents, then enter the number. Sides use any one unit; angles are in degrees (0° to 90°, exclusive).

a
3
b
4
c (hyp)
5
FunctionDefinition
sin(A)a / c (opposite / hypotenuse)
cos(A)b / c (adjacent / hypotenuse)
tan(A)a / b (opposite / adjacent)
Pythagoreana² + b² = c²
A + B= 90° (always)

Results

PropertyValue
Leg a3
Leg b4
Hypotenuse c5
Angle A36.86989765°
Angle B53.13010235°
Angle C90°
Perimeter12
Area6

Trig Ratios (Angle A)

sin(A)0.6
cos(A)0.8
tan(A)0.75

Give this calculator legs of 1,000 and 1 and the hypotenuse comes back as 1,000.0005, only five ten-thousandths longer than the long leg, while angle A lands at 89.94270424°. A triangle that thin looks like a single line, and the numbers agree. The page works from any two of leg a, leg b, hypotenuse c, angle A and angle B, with angle C fixed at 90°.

A typical solve, then the awkward inputs

Typical case: hypotenuse c = 12 and angle A = 35°. Leg a sits opposite angle A, so a = c × sin 35° = 6.882917236. Leg b = c × cos 35° = 9.829824531. Angle B = 90° − 35° = 55°. The perimeter is 28.71274177 and the area, ½ab, is 33.82893435. The page also lists the trig ratios of A: sin 0.5735764364, cos 0.8191520443 and tan 0.7002075382.

Other pairs use the same toolkit. Two legs give c = √(a² + b²) and A = arctan(a / b). A leg plus the hypotenuse gives the other leg from √(c² − leg²). A leg plus an angle uses tangent for the other leg and sine for the hypotenuse. Results show up to ten significant digits.

Now the awkward inputs, each of which gets a specific message. A leg equal to or longer than the hypotenuse, such as a = 5 with c = 5 or c = 4, produces Hypotenuse must be longer than either leg, because a leg equal to c would force the other leg to zero. An angle of 0° or less, or of 90° or more, is rejected with a message naming the angle, and a zero or negative side is caught as well. Two angles cannot fix a size: if they add up to 90°, such as 40° and 50°, the page asks you to add a side length, and if they do not, such as 40° and 40°, it points out that A and B must add up to 90° and shows the 80° you entered.

Finally, angles are read as degrees only, and the page says so beside the inputs. With a = 10, typing 0.6 meaning radians is treated as 0.6° and yields b = 954.8947517. Convert radians to degrees before typing.

How to Use This Calculator

  1. Set the first value type, for example Leg a, and type its number. The page opens with a = 3 and b = 4.
  2. Set the second value type and its number. The two types must differ, or the page asks you to select two different values. Sides share one unit of your choice and angles are in degrees.
  3. Read a, b and c in the three boxes, then the full table for angles A and B, perimeter and area.
  4. Check the trig ratios below the table. They refer to angle A only.
  5. Change either type or value to test a variation. The result updates immediately, and any problem with the pair is explained in red under the inputs.

Frequently Asked Questions

Which leg is a and which is b?

Leg a is opposite angle A, and leg b is opposite angle B. Swapping the labels swaps A and B but leaves c, perimeter and area unchanged. The page's own ratios say sin A = a / c and tan A = a / b.

Why do I get a message instead of a result when I enter two angles?

Two angles in a right triangle are not independent, since A + B = 90°, and neither says anything about size. If they add up to 90° the page asks for a side length. If they do not, it tells you the sum you entered and reminds you that A and B must total 90°.

How do I get a ramp's angle and percent grade?

Use Leg a as the rise and Leg b as the run. For a ramp rising 1 for every 12 of run, angle A is 4.763641691° and tan A is 0.08333333333, which is a grade of 8.33 percent when multiplied by 100.

The trig ratios shown are for A. What about B?

They swap. sin B equals cos A and cos B equals sin A, while tan B is 1 divided by tan A. For the 3-4-5 triangle, A = 36.86989765° and B = 53.13010235°.

Can I use this for a triangle that is not exactly square-cornered?

No. Angle C is always 90°. For other triangles, use the general triangle calculator, which uses the laws of sines and cosines.