gizmobench
BrowseDaily

Right Triangle Calculator

Solve a right triangle from two sides or one side and one acute angle. Enter the legs a and b, hypotenuse c, or angles A and B; C is fixed at 90 degrees. Read the missing lengths and angles, area, perimeter and altitude to the hypotenuse, with Calculation steps for your actual values and sine, cosine and tangent for both acute angles. The 30–60–90 and 45–45–90 controls open editable numeric examples. The Three sides page solves any plane triangle from all three lengths, while Angle sum finds a third interior angle from two given angles.

a = 5b = 12c = 13ABC
Solveda and b given
a
5
leg opposite A
b
12
leg opposite B
c
13
hypotenuse
A
22.6199°
opposite a
B
67.3801°
opposite b
C
90°
the right angle
area
30
half of a times b
perimeter
30
a + b + c
altitude
4.61538
to the hypotenuse
Known
a
b
c
A (°)
B (°)
Angles in

Fill any two of the five boxes: the legs a and b, the hypotenuse c, or one of the acute angles A and B. The other three, the area, the perimeter and the altitude follow. Angle C is the right angle.

Sine, cosine and tangent. For angle A, a is opposite and b is adjacent. For B, those roles swap.
sin A = a / c
0.384615384615
cos A = b / c
0.923076923077
tan A = a / b
0.416666666667
sin B = b / c
0.923076923077
cos B = a / c
0.384615384615
tan B = b / a
2.4
Working for your triangle.
  1. c = √(a² + b²) = √(5² + 12²) = 13.
  2. A = arctan(a / b) = arctan(5 / 12) = 22.619864948 degrees.
  3. B = 90 degrees − A = 67.380135052 degrees; C = 90 degrees.
  4. Area = a × b / 2 = 5 × 12 / 2 = 30.
  5. Perimeter = a + b + c = 5 + 12 + 13 = 30.
  6. Altitude to c = a × b / c = 5 × 12 / 13 = 4.61538461538.
  • Three sides8, 15, 17
    right angled · 28.0725° and 61.9275° · area 60
  • Leg and anglea = 10, A = 30°
    b = 17.3205, c = 20 · area 86.6025
  • Angle sumone acute angle is 34°
    90° + 34° + 56° = 180°
How the three modes work. A right triangle has five values: the legs a and b, the hypotenuse c, and the acute angles A and B, with C fixed at a right angle. Any two of them fix the triangle, so two boxes are what the tool asks for: sides come from Pythagoras, angles from the inverse sine, cosine and tangent, and the altitude is the perpendicular dropped onto the hypotenuse, a times b over c. Two angles are refused, because they set the shape and not the size. Three sides go to the law of cosines instead, which works on any triangle and says whether it is right, acute or obtuse, with the area from Heron’s formula. Two angles of any triangle give the third from the 180 degree sum. Exact trigonometry to the precision of the numbers you enter, with every side and angle shown in degrees or radians. It cannot know your units or your measurement error, and it is geometry only, not a structural calculation.

Open Right Triangle Calculator, Three Side Calculator, or Triangle Angle Sum Calculator. For a general triangle with a mixture of sides and angles, use Triangle Calculator. Convert a pitch ratio such as 6:12 to an angle with Roof Pitch Calculator, then enter that angle and an actual length here for geometric rise or sloping length.

Common questions

Which two values are enough to solve a right triangle?
Any two except two angles. Two legs: 3 and 4 give a hypotenuse of exactly 5. A leg and the hypotenuse: 5 and 13 give the other leg as exactly 12. A leg and an acute angle: a = 1 with A = 30 degrees gives a hypotenuse of exactly 2. The hypotenuse and an angle: c = 20 with A = 30 gives a = 10. Two angles are refused, and the tool says why: A and B set the shape of the triangle but not its size, so every triangle with those angles would be a correct answer. Fill a third box and it asks you to clear one instead of quietly ignoring it, because three values can disagree with each other.
What is the altitude the tool shows?
The perpendicular dropped from the right angle onto the hypotenuse, which is the height of the triangle when the hypotenuse is the base. It is the product of the two legs divided by the hypotenuse, so a 3-4-5 triangle has an altitude of exactly 2.4. It is the number you want when a right triangle is a gusset, a gable or a sail and you need the clearance from the corner to the long side. The area row uses the legs instead, half of a times b, which is the same area by a shorter route.
Can I work in radians instead of degrees?
Yes, and switching does not change your triangle. The Angles in control flips between degrees and radians, and the numbers already in the angle boxes are rewritten as it goes, so 30 becomes 0.523598775598 and back again. A right angle is 90 degrees or 1.5708 radians, and the three angles of a triangle add to 180 degrees or pi radians. The label on each angle box changes with the unit, so a box asking for radians never gets read as degrees.
How is the side-side-side page different?
It drops the right angle. The right triangle mode assumes angle C is 90 degrees and uses Pythagoras and the inverse sine, cosine and tangent. The side-side-side page takes all three sides of any triangle and uses the law of cosines for the three angles and Heron's formula for the area, then says whether the triangle is right, acute or obtuse from its largest angle. Three sides that cannot meet, like 1, 2 and 10, are named as such rather than answered: any two sides of a triangle must add to more than the third. Three that add up exactly, like 1, 2 and 3, lie flat in a straight line and have no area.
Does it handle a triangle that is not right angled?
On two of its three modes, yes. Three sides solves any triangle by the law of cosines, and the angle sum takes any two angles and gives the third. What the tool does not do is solve a general triangle from a mixture of sides and angles, the side-angle-side and angle-side-angle cases: those need the law of sines and are not built here. The right triangle mode is exactly what its name says, a triangle with one 90 degree corner, and it will refuse an acute angle of 90 or more rather than pretend otherwise.
Is anything uploaded, and are my numbers kept?
Nothing is uploaded. The trigonometry runs in your browser, and the page makes no request while you type. The numbers in the boxes, the mode and the angle unit are remembered in this browser alone so the page opens where you left it, and clearing your site data removes them. The figures on the stage are rounded for reading, six significant figures for a length and four decimal places for an angle in degrees, and the Copy button gives you those same figures; the arithmetic behind them is full double precision.
Can I calculate a 30–60–90 or 45–45–90 special right triangle?
Yes. Press the corresponding example button, then replace leg a with your own length. In a 30–60–90 triangle, a is opposite 30 degrees, b is the longer leg and c is twice a. A short leg of 6 gives c = 12 and b about 10.3923. In a 45–45–90 triangle the legs are equal and c is the leg times the square root of 2. Results are decimal numbers; the boxes do not parse radical expressions such as sqrt(2).
Where are sin, cos and tan for my triangle?
The Trigonometric ratios region shows all six values. For angle A, sin A = a/c, cos A = b/c and tan A = a/b. For B, a and b swap roles. A 3-4-5 triangle gives sin A = 0.6, cos A = 0.8 and tan A = 0.75. Enter enough known sides or an acute angle and a side so the triangle can be solved first.
Does this show the calculation steps?
Yes. The live working uses your supplied values in Pythagoras or sine/cosine side formulas, gives the other acute angle, then shows Area = a × b / 2, perimeter = a + b + c and altitude = a × b / c. Copy includes the solved values, trig ratios and working. The three-side page shows cosine-law and Heron working, and Angle sum shows the subtraction for its third angle.
Can I enter inches or calculate square feet?
Use one consistent length unit for every side. If lengths are decimal inches, the solved lengths are inches and area is square inches; decimal feet give square feet. Mixed feet-and-inches strings and fractions such as 3/4 are not parsed. Convert those to one decimal unit first. Extreme inputs that exceed the numeric range or collapse a positive angle or area are refused instead of displaying a blank or zero result.
Can I find horizontal distance, roof height or a sloping length from an angle?
For an angle A measured above horizontal, a is the rise, b is the horizontal run and c is the sloping length. Enter that angle and one actual length. For example, c = 20 and A = 30 degrees give rise a = 10 and horizontal b about 17.3205. For a ratio pitch such as 6:12, first convert it to an angle with Slope Calculator’s Roof pitch mode, then use that angle and your measured run here. This computes plane geometry, not roof construction or structural capacity.
What triangle problems are outside these three modes?
For a general triangle mixing sides and angles, use Triangle Calculator, which includes SAS, ASA, AAS and ambiguous SSA cases. These three modes do not compare two triangles for similarity or congruence, apply a side-splitter or exterior-angle theorem, interpret an uploaded worksheet, solve spherical triangles or calculate a triangular solid’s volume. A hypotenuse alone does not fix a right triangle, and two general side lengths do not fix a third side without another constraint.

Exact trigonometry to the precision of the numbers you enter, with every side and angle shown in degrees or radians. It cannot know your units or your measurement error, and it is geometry only, not a structural calculation.