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°.

Two Known Values

Select what each value represents, then enter the number.

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.88291724. Leg b = c × cos 35° = 9.82982453. 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.57357644, cos 0.81915204 and tan 0.70020754.

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 are rounded to eight decimals.

Now the awkward inputs. Leg a = 5 with c = 5 would force leg b to zero, and the page replies Invalid combination, check your values. Leg a = 5 with c = 4 triggers Hypotenuse must be greater than any leg. An angle of 0° or 90° is rejected with a message that the angle must be between 0° and 90°, and a zero or negative side is caught too. Two angles with no side give no result at all, because angles fix a shape, not a size. Finally, angles are read as degrees only: with a = 10, typing 0.6 meaning radians is treated as 0.6° and yields b = 954.8947517.

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.
  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.

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 see no 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. The page needs at least one side, so it simply shows nothing until you provide one.

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.76364169° and tan A is 0.08333333, 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.