Right Triangle Calculator

Enter any two parts of a right triangle, two legs, a leg and the hypotenuse, a leg and an acute angle, or the hypotenuse with an angle, and get every remaining side and angle plus the area, perimeter and all six trigonometric ratios, with a labeled drawing to scale.

What you get
  • Nine input combinationsTwo legs, hypotenuse plus a leg, a leg with an angle, or c with an angle.
  • All six trig ratiossin, cos and tan for both acute angles, with the fractions shown.
  • Drawing to scaleRight angle marked, hypotenuse highlighted, every part labeled.

What do you know?

Results update as you type

The two legs (a and b) with the right angle between them. The hypotenuse c always sits opposite the 90° angle.

Runs entirely in your browser. Nothing you type is sent or saved

Right triangle guide

What makes a right triangle special

A right triangle is any triangle with one 90° angle, and that single fact changes everything about how easy it is to work with. The two sides that meet at the right angle are the legs (a and b here), and the side opposite the right angle is the hypotenuse (c), always the longest side. The right angle forces the other two angles to cooperate: they must share the remaining 90° between them, so knowing either one immediately gives the other.

Two famous relationships only hold because of the right angle. The Pythagorean theorem, a² + b² = c², connects the three sides without ever mentioning an angle. And the three trigonometric ratios, sine, cosine and tangent, are defined directly from the sides, which makes a right triangle the only kind of triangle where a side and an angle are related by a simple fraction. This page works through the classic 3-4-5 triangle: legs a = 3 and b = 4, hypotenuse c = 5.

SOH-CAH-TOA: the three ratios

Every trigonometric ratio compares two sides of a right triangle relative to one of its acute angles. The mnemonic SOH-CAH-TOA packs up all three definitions:

sin A = opposite ÷ hypotenuse = a ÷ c

Sin is Opposite over Hypotenuse

cos A = adjacent ÷ hypotenuse = b ÷ c

Cos is Adjacent over Hypotenuse

tan A = opposite ÷ adjacent = a ÷ b

Tan is Opposite over Adjacent

For the 3-4-5 triangle with angle A opposite the leg of 3: sin A = 3/5 = 0.6, cos A = 4/5 = 0.8 and tan A = 3/4 = 0.75. Those three numbers pin the angle down: A = arcsin(0.6) = 36.8699°, and angle B is whatever is left of 90°, namely 53.1301°. The calculator's trig table shows every ratio for both angles with the actual fractions substituted, so you can see the definitions working rather than trusting decimals.

Why the ratios matter: they are what turns an angle into a length. Any design question of the form "I know the slope of this ramp, how far does it rise?" is a tangent ratio, and "how long is this support?" is a cosine ratio away from an answer.

Solving from a leg and an angle

When one leg and one acute angle are known, the trig ratios work in reverse to deliver the remaining sides. Suppose leg a = 3 and angle A = 36.8699°. Since a is opposite A:

  • Hypotenuse: sin A = a/c, so c = a ÷ sin A = 3 ÷ 0.6 = 5.
  • Other leg: tan A = a/b, so b = a ÷ tan A = 3 ÷ 0.75 = 4.

One division each, no Pythagoras needed, though checking a² + b² = 9 + 16 = 25 = c² confirms the answer. The same idea with the hypotenuse known uses sin or cos directly, and with a leg-plus-hypotenuse pair, the Pythagorean theorem alone finishes the job. The calculator offers all nine of these combinations as mode buttons, including hypotenuse with an angle, where a = c × sin A and b = c × cos A.

The two angles always complement

Because the three angles of any triangle total 180° and one of them is fixed at 90°, the two acute angles of a right triangle must always add to exactly 90°: A + B = 90°. This is more than trivia; it is a solving tool. Find A = 36.8699° from a sine table and B comes free at 53.1301°, no second lookup needed. It is also a built-in error check: if your two computed acute angles do not sum to 90°, an input or a rounding step went wrong somewhere. The results panel prints the sum so you can confirm it at a glance.

Special right triangles

Two angle patterns come up so often in schoolwork, carpentry and design that their side ratios are worth memorizing:

  • The 45-45-90 triangle (the isosceles right triangle): the legs are equal and the hypotenuse is a leg times √2. With legs of 5, the hypotenuse is 5 √2 = 7.0711. Every half-square diagonal is one of these.
  • The 30-60-90 triangle: the sides opposite 30°, 60° and 90° are in the ratio 1 : √3 : 2. With the shortest side 4, the longer leg is 4 √3 = 6.9282 and the hypotenuse is 8. It is half of an equilateral triangle, which is why it appears whenever hexagons and equilateral geometry do.

Try either pattern in the calculator: enter legs 4 and 6.9282 and the angles come back 30° and 60° to within display rounding. The presets on the angle modes include both families so you can reproduce them in one click.

Where right triangles show up

  • Ladders and safety rules: a ladder leaning at 65° reaches 4 × sin 65° = 3.6252 meters up a wall if it is 4 meters long. Safety guidance about ladder angles is applied trigonometry.
  • Roof pitch: a pitch quoted as "6 in 12" means 6 inches of rise per 12 inches of run, tan A = 6/12 = 0.5, so A = 26.5651°, and rafters are cut to that angle.
  • Accessibility ramps: the common 1:12 slope standard is a tangent ratio of 1/12 = 0.0833, an angle of 4.7636°, and ramp length follows from the rise by the Pythagorean theorem.
  • Navigation and surveying: north-south and east-west displacements are the legs of a right triangle whose hypotenuse is the actual distance traveled.
  • Screen and paper sizes: a "27-inch" diagonal with a 16:9 shape is a hypotenuse problem, solved with the Pythagorean theorem scaled by the aspect ratio.

Using the calculator well

  • Match the mode to your diagram: the nine buttons name exactly the two parts you know. The little diagram above the fields shows which letter is a leg, which is the hypotenuse and where angles A and B sit, so "leg a with angle B" is unambiguous.
  • Angles are in degrees, strictly between 0 and 90. An angle of exactly 0° or 90° would collapse the triangle, so the calculator rejects them.
  • The hypotenuse must win: in the hypotenuse-plus-leg modes, c has to be strictly larger than the leg you enter. Entering c = 3 with a = 5 is flagged as impossible rather than solved with an imaginary result.
  • Units flow through: enter legs in feet and the area comes back in square feet. Keep every input in the same unit; mixing meters and centimeters is the most common real-world mistake.
  • Use the ratio table as a check: for the 3-4-5 triangle the table shows sin A = 3/5. If you can see the fraction and the decimal agreeing, the whole solution is internally consistent.
  • General triangles need the general tool: when no angle is 90°, the Pythagorean theorem and these ratios do not apply. Use the general triangle calculator, which solves with the law of sines and law of cosines instead.

Common questions

It is a memory hook for the three trig ratios in a right triangle: Sine is Opposite over Hypotenuse, Cosine is Adjacent over Hypotenuse, Tangent is Opposite over Adjacent. "Opposite" and "adjacent" are always relative to the angle you are working with, so pick your angle first, name its two legs, then read the matching ratio.

Not the plain SOH-CAH-TOA versions, because those definitions are built from the sides that a right angle guarantees. Oblique triangles use the law of sines and the law of cosines, which are the general versions of the same idea. If your triangle has no 90° angle, the general triangle calculator is the right tool.

Because the hypotenuse is always the longest side: it must be strictly greater than either leg. With c = 3 and a = 5 the Pythagorean theorem would demand b² = 9 - 25 = -16, an impossible length. The message flags the impossible pair rather than quietly producing a nonsense answer.

Never. Doubling every side turns 3/5 into 6/5 over 10, which is still 0.6. The ratios depend only on the angles, which is the property that makes similar triangles useful and why a single angle determines every ratio. What changes with scale are the side lengths, the area (by the square of the factor) and nothing else.

Measure 3 units along one edge, 4 along the crossing edge, and check the diagonal between the marks: if it measures exactly 5, the corner is a true 90°, because 3² + 4² = 5². Builders scale it up (6-8-10, 30-40-50) for accuracy over distance. It is the fastest square-check that needs no tools beyond a tape.

Form the ratio that matches the two sides you have and apply the inverse function. With opposite and hypotenuse known, A = arcsin(opposite/hypotenuse); with adjacent and hypotenuse, A = arccos(adjacent/hypotenuse); with the two legs, A = arctan(opposite/adjacent). This calculator does all three automatically: enter the two sides and the angles appear in the results.

The mathematics is computed at full floating-point precision and only the display is rounded, so recomputing a rounded answer by hand can differ in the last decimal. For irrational results such as a hypotenuse of √2, the decimal shown is an approximation of an exact value that has no finite decimal form.

No. Every calculation runs in your browser. Nothing is stored or transmitted.

Two parts in. The whole triangle out.

Browse all math calculators