Lelifi·tools

Right Triangle Calculator

A right triangle with legs of 30 and 120 has a hypotenuse of 123.69, with acute angles of 14.04 and 75.96 degrees. Its area is 1,800 square units, its perimeter is 273.69, and the altitude to the hypotenuse is 29.1.

Pick the two measurements you have, then enter them. The calculator fills in the third side, both angles, the area and the circle sizes. Everything runs in your browser.

Enter any two measurements from a right triangle and get the missing side, both angles, the area, the perimeter and the circles that fit inside and outside.

By the Lelifi editors ·

Key takeaways

A 30-120 right triangle drawn to scale a = 30 b = 120 c = 123.69 14.04 deg right angle Area 1,800 square units. Perimeter 273.69. Altitude to c is 29.1.
The 30 and 120 inch ramp from the worked example, with the walking surface as the hypotenuse.
A 4:12 roof: 8 ft rise over 24 ft run run = 24 ft rise 8 ft rafter = 25.30 ft 18.43 deg pitch 4:12, from an 8 ft rise over a 24 ft run
A 4:12 roof seen as a right triangle: the run is horizontal, the rise is vertical, the rafter is the hypotenuse.
On this page
  1. The five numbers that describe a right triangle
  2. Which two numbers you need, and the formula for each case
  3. Worked example: a ramp that has to pass inspection
  4. Worked example: turning a roof pitch into an angle
  5. Going the other way: from an angle and one side
  6. Area, perimeter, altitude and the two circles
  7. How this page differs from the Pythagorean calculator
  8. Mistakes that throw the answer off

The five numbers that describe a right triangle

A right triangle has one 90 degree corner. Everything else about it comes from that one fact. There are three sides: the two legs, written a and b, and the hypotenuse c, which sits across from the right angle and is always the longest side. There are two acute angles, A across from side a and B across from side b.

NASA's Glenn Research Center puts the angle rule in one line: in a right triangle the two remaining angles add to 90 degrees. That means one measured angle hands you the other for free, and it also means a right triangle only needs two measurements before every other number is fixed.

Two measurements can be any pair of sides, or one side plus one acute angle. Pick the pair you have on the job, enter it, and the calculator returns the third side, both angles, the area, the perimeter, the altitude to the hypotenuse, and the radius of the circle that fits inside and the one that fits outside.

All lengths must be in the same unit. The unit menu only changes the labels, not the arithmetic, so a triangle measured in inches behaves the same as one measured in meters.

Which two numbers you need, and the formula for each case

Four starting points cover almost every real measurement. Each one uses a different rearrangement of the same three relationships: the Pythagorean theorem, the sine ratio and the cosine ratio.

You knowWhat the calculator doesExample
Both legs, a and bc = sqrt(a^2 + b^2), then A = atan(a / b)30 and 120 give a hypotenuse of 123.69 and an angle of 14.04 degrees
One leg and the hypotenuseb = sqrt(c^2 - a^2), then A = asin(a / c)9 and 15 give a missing leg of 12 and an angle of 36.87 degrees
One leg and the angle across from itb = a / tan(A), c = a / sin(A)30 at 14.04 degrees gives 120 and 123.69
The hypotenuse and an anglea = c x sin(A), b = c x cos(A)20 at 75.52 degrees gives 19.36 and 5.00

The order matters in one place. When you know a leg and the hypotenuse, the hypotenuse has to be the larger number. If you type them the other way round the calculator stops and tells you so, instead of returning an error you cannot see.

Angles in these formulas are measured from the leg b, not from the hypotenuse. That is the usual convention: angle A opens onto side a. If you were taught to measure from the other leg, swap the names and the answers still hold.

Worked example: a ramp that has to pass inspection

A loading dock is 30 inches above the parking lot and the ramp runs 120 inches out from the wall. The walking surface is the hypotenuse, and the calculator returns 123.69 inches for it. The slope angle is 14.04 degrees, the area under the ramp is 1,800 square inches, and the perimeter of the triangle is 273.69 inches.

That ramp is far too steep for a public building. The 2010 ADA Standards, section 405.2, cap a ramp run at a slope of 1:12, which is 8.33 percent, or 4.76 degrees. For a 30 inch rise the required run is 30 x 12 = 360 inches, which is 30 feet. The 120 inch run in this example is one third of what the standard asks for, so the same rise needs three times the distance.

Run the numbers backwards and the tool is just as useful for planning. Enter a hypotenuse of 360 inches and an angle of 4.76 degrees, and the rise comes back at about 29.9 inches, close enough to confirm the layout before anyone cuts lumber.

Worked example: turning a roof pitch into an angle

Roof work is usually described as pitch, such as 4:12, meaning 4 inches of rise for every 12 inches of horizontal run. The angle that a saw or a framing square cares about is the arctangent of that ratio, so a 4:12 roof sits at 18.43 degrees.

Take a gable with an 8 foot rise and a 24 foot run from the ridge to the outside wall. The rafter length is the hypotenuse: 25.30 feet. The pitch is 8 / 24, which reduces to 4:12. If you feed the rafter length in as if it were the run, the calculator returns 17.55 degrees instead of 18.43, a difference that shows up as a visible gap at the ridge.

PitchRise per 12 of runAngle from horizontal
3:123 in14.04 degrees
4:124 in18.43 degrees
5:125 in22.62 degrees
6:126 in26.57 degrees
8:128 in33.69 degrees
12:1212 in45.00 degrees

For a full material takeoff, the dedicated roof pitch calculator and the rafter length calculator carry the same math with shingle and overhang inputs added. This page is the geometry underneath them.

Going the other way: from an angle and one side

Angles are often easier to measure than lengths. A 20 foot extension ladder set against a wall is a right triangle where the ladder is the hypotenuse and the wall is one leg. OSHA's ladder rule, 29 CFR 1926.1053(b)(5)(i), asks for the foot of the ladder to sit about one quarter of the working length away from the wall, and one quarter of the length means the angle from the ground is 75.52 degrees.

Enter 20 feet as the hypotenuse and 75.52 degrees as angle A, and the top of the ladder reaches 19.36 feet up the wall while the foot sits 5.00 feet out. Set the same ladder at 65 degrees and it reaches only 18.13 feet, with the foot 8.45 feet from the wall, which is well outside the 4 to 1 rule and a good way to watch a ladder slide.

The same move solves screen and sightline problems. A 55 inch television measured on the diagonal, viewed straight on, is a hypotenuse, and the width falls out of the angle only if you also know the aspect ratio. For that case the aspect ratio calculator is the faster route.

Area, perimeter, altitude and the two circles

Four less obvious numbers fall straight out of the sides once you have them. The area is half the product of the legs, since either leg can be the base and the other is then the height. The perimeter is just the three sides added.

The altitude to the hypotenuse is the shortest distance from the right angle to the long side, and it equals the product of the legs divided by the hypotenuse. That number matters when you are hanging a light or running a brace between the corner and the long side.

The two circles are the ones people forget. A right triangle's inradius, the radius of the largest circle that fits inside it, is (a + b - c) / 2. Wolfram MathWorld's right triangle entry gives that form and notes the equivalent r = ab / (a + b + c). The circumradius is half the hypotenuse, because the hypotenuse is a diameter of the circumscribed circle.

For a 9-12-15 triangle the answers are: area 54, perimeter 36, altitude 7.2, inradius 3, circumradius 7.5. Those are exact, not rounded, which is why carpenters still like 3-4-5 and its multiples.

Whole number tripleAnglesAreaInradius
3-4-536.87 and 53.13 degrees61
5-12-1322.62 and 67.38 degrees302
8-15-1728.07 and 61.93 degrees603
7-24-2516.26 and 73.74 degrees843
20-21-2943.60 and 46.40 degrees2106

Scaling a triple keeps the angles and multiplies the area by the square of the scale. Doubling 3-4-5 to 6-8-10 keeps 36.87 degrees but takes the area from 6 to 24, a factor of four.

How this page differs from the Pythagorean calculator

We already publish a Pythagorean theorem calculator, and the two pages do different jobs. That one starts from two legs, returns the hypotenuse and also handles a three dimensional box diagonal. It is the right tool when you are checking a square corner or measuring the diagonal of a crate.

This page starts from any two of the five numbers, including cases the theorem cannot touch, such as one leg plus an angle, or the hypotenuse plus an angle. It also returns the two angles, the pitch in rise per 12, the altitude and both circle radii, which the other page does not compute.

The rule of thumb: if you have two sides and want the third, either page works. If you have an angle, or you need the angle, this is the page.

Mistakes that throw the answer off

Most wrong answers from a triangle calculator come from the input, not the formula. These are the four that show up most often.

Mixing units. A 30 inch rise and a 10 foot run is 30 and 120, not 30 and 10. Entering 30 and 10 gives a hypotenuse of 31.62 and an angle of 71.57 degrees, both meaningless for the job.

Calling the wrong side the hypotenuse. The hypotenuse is across from the right angle and is always the longest side. If the number you type as c is shorter than a leg, the calculator refuses and asks you to check.

Rounding the angle too early. Half a degree sounds harmless until the run is long. At 20 feet, half a degree moves the far end by about 0.17 feet, roughly 2 inches, which is enough to miss a joist.

Assuming a right angle that is not there. A 3-4-6 triangle looks plausible but is not right: 9 + 16 = 25, and 25 is less than 36, so the corner opposite the 6 opens to more than 90 degrees. Check with the converse of the theorem before you trust any of the numbers above.

Frequently asked questions

How do I find the hypotenuse from two legs?

Square both legs, add them, and take the square root. Legs of 6 and 8 give 36 + 64 = 100, so the hypotenuse is 10. Legs of 30 and 120 give 15,300, so the hypotenuse is 123.69.

How do I find a missing leg when I know the hypotenuse?

Square the hypotenuse, subtract the square of the known leg, then take the square root. A hypotenuse of 13 with a leg of 5 leaves 169 - 25 = 144, so the other leg is 12.

What can I do if I only know one angle?

Add one side. One angle plus one side fixes the whole triangle: a 30 degree angle with a 10 foot hypotenuse gives legs of 5.00 and 8.66 feet.

What are the angles of a 3-4-5 triangle?

36.87 degrees across from the 3 and 53.13 degrees across from the 4. They add to 90, which is the check that the triangle is right.

How do I turn a roof pitch into degrees?

Take the arctangent of rise divided by run. A 6:12 pitch is 0.5, which is 26.57 degrees. A 12:12 pitch is 45 degrees.

What is the area of a right triangle with legs of 9 and 12?

Half of 9 times 12, which is 54 square feet if the legs are in feet. The hypotenuse of that triangle is 15, so the perimeter is 36 feet.

What is the altitude to the hypotenuse?

Multiply the two legs and divide by the hypotenuse. For a 9-12-15 triangle that is 108 / 15 = 7.2 feet.

What is the inradius of a right triangle?

Add the legs, subtract the hypotenuse, and divide by 2. For 9-12-15 the answer is 3 feet. For a 3-4-5 triangle it is 1.

What is 1:12 slope in degrees?

4.76 degrees, which is 8.33 percent. The 2010 ADA Standards use that as the steepest allowed running slope for a ramp.

Can a right triangle have an angle of 100 degrees?

No. The right angle already uses 90 degrees, and the other two have to add to 90, so each of them stays below 90.

How many square feet is a triangle with legs of 30 and 120 inches?

1,800 square inches, which is 1,800 / 144 = 12.5 square feet.

Is a 5-12-13 triangle a right triangle?

Yes. 25 + 144 = 169, and the square root of 169 is 13, so the converse of the Pythagorean theorem holds.

Why does this page give a different answer from the Pythagorean calculator?

They start from different inputs. That page takes two legs and adds a box diagonal; this one takes any two of the five numbers, including one side plus an angle, and also returns the angles, pitch and circle radii.

Do I need to convert inches to feet first?

No, as long as every length uses the same unit. A triangle in inches returns inches squared for area and inches for the radii. Convert at the end by dividing square inches by 144 to get square feet.

Spotted a wrong number or a broken result?

More Math tools

See all Math tools

Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.