Skip to content

How to Solve a Right Triangle: SOH-CAH-TOA and the Pythagorean Theorem

By Ashna BashirReviewed by Muhammad Azeem13 min readUpdated 30 September 2026

How to solve a right triangle with the Pythagorean theorem and the three SOH-CAH-TOA trig ratios, with worked examples for several different combinations of known values.

Knowing how to solve a right triangle means finding every side and every angle from whatever partial information is already known, usually two of those six values. A right triangle is the easiest kind of triangle to solve, because one of its three angles is already fixed at exactly 90 degrees before any measuring or calculating happens at all. That single fixed angle is what makes two tools, the Pythagorean theorem and the three SOH-CAH-TOA trigonometric ratios, powerful enough to solve the whole shape without ever reaching for the more general law of sines or law of cosines a non-right triangle would require.

This guide covers both tools in full: the Pythagorean theorem and why it only works on right triangles, the three trig ratios and exactly when to reach for each one, and worked examples across several different starting combinations of known values, including the hypotenuse-and-angle case that is one of the most common real-world setups but is often left out of a basic trigonometry lesson. For solving any of these combinations instantly, the right triangle calculator covers six different starting pairs of known values and always returns every side, both acute angles, the area and the perimeter together.

The naming convention this article uses

A right triangle's 90 degree right angle sits at a vertex this article, and the calculator it accompanies, calls C. The two shorter sides that form that right angle are the legs, labeled a and b. The longest side, always opposite the right angle, is the hypotenuse, labeled c. Angle A sits opposite leg a, and angle B sits opposite leg b. The degrees in a triangle always total 180, and the right angle already accounts for 90 of them, so angles A and B always add up to exactly 90 degrees between them, no matter the triangle's actual size or proportions.

The Pythagorean theorem: when both known values are sides

The Pythagorean theorem states that a squared plus b squared equals c squared, connecting the two legs to the hypotenuse. It is the right tool whenever both already-known values are sides, whether that is both legs, or one leg together with the hypotenuse, and it says nothing at all about angles on its own.

a^2 + b^2 = c^2

Why it only works on a right triangle. The theorem's classic geometric proof builds an actual square on each of the triangle's three sides and shows that the two smaller squares, built on the legs, have a combined area exactly equal to the larger square built on the hypotenuse. That equality depends entirely on the angle between the two legs being exactly 90 degrees; change that angle to anything else and the areas no longer match up, which is exactly why a non-right triangle needs the law of cosines, a generalized version of the same relationship that adds a correction term for whatever the actual angle is.

How to find the hypotenuse of a right triangle when both legs are known. Rearranged as c equals the square root of a squared plus b squared, the theorem finds the hypotenuse directly. Worked example: a ramp's horizontal run is 12 feet and its vertical rise is 5 feet. The ramp's actual sloped length is the square root of 12 squared plus 5 squared, the square root of 144 plus 25, the square root of 169, exactly 13 feet.

How to find the missing side of a right triangle from a leg and the hypotenuse. Rearranged as b equals the square root of c squared minus a squared, the theorem finds the missing leg instead. Worked example: a 15 foot ladder is leaning with its base 9 feet from the wall. The height it reaches up the wall is the square root of 15 squared minus 9 squared, the square root of 225 minus 81, the square root of 144, exactly 12 feet.

In both cases, the theorem alone does not produce either acute angle. That is where the three trig ratios take over.

SOH-CAH-TOA: the three ratios and when to use each

SOH-CAH-TOA is a memory aid for the three basic trigonometric ratios that connect a right triangle's sides to its acute angles.

sin A = opposite/hypotenuse; cos A = adjacent/hypotenuse; tan A = opposite/adjacent

SOH: sine equals opposite over hypotenuse. For a given acute angle, sine is the length of the side opposite that angle divided by the hypotenuse. Use it whenever an angle and the hypotenuse are involved, either both known (to find the opposite side) or the opposite side and hypotenuse both known (to find the angle, using the inverse sine).

CAH: cosine equals adjacent over hypotenuse. Cosine is the side adjacent to the angle (the leg that touches the angle but is not the hypotenuse) divided by the hypotenuse. Use it in the same situations as sine, but when the adjacent leg is the one involved instead of the opposite leg.

TOA: tangent equals opposite over adjacent. Tangent connects the two legs directly, with no hypotenuse involved at all. It is the right choice whenever an angle and one leg are known and the other leg is the target, or when both legs are known and an angle is the target, using the inverse tangent.

One detail trips up more people than the ratios themselves: opposite and adjacent are never fixed to one particular side of the triangle. They are defined relative to whichever angle is currently in use. Leg a is opposite angle A but adjacent to angle B; leg b is opposite angle B but adjacent to angle A. Picking the correct ratio always starts with picking which angle is the reference point.

Worked example: two legs known (Pythagorean theorem plus arctangent)

A right triangle has legs a = 3 and b = 4. The Pythagorean theorem gives the hypotenuse: c equals the square root of 3 squared plus 4 squared, the square root of 9 plus 16, the square root of 25, exactly 5.

For angle A, TOA applies directly since both legs are known and the hypotenuse is not needed: the tangent of angle A is opposite over adjacent, a over b, or 3/4. Taking the inverse tangent of 0.75 gives angle A of approximately 36.87 degrees, and angle B is 90 minus that, approximately 53.13 degrees. This is the classic 3-4-5 right triangle, and it recurs throughout this article precisely because its whole-number sides make every ratio easy to check by hand.

Worked example: a leg and the hypotenuse known (Pythagorean theorem plus arcsine)

A right triangle has leg a = 3 and hypotenuse c = 5. The Pythagorean theorem gives the other leg: b equals the square root of 5 squared minus 3 squared, the square root of 25 minus 9, the square root of 16, exactly 4, the same 3-4-5 triangle approached from a different starting pair.

For angle A, SOH applies since a and c are both known: the sine of angle A is opposite over hypotenuse, a over c, or 3/5, or 0.6. The inverse sine of 0.6 is approximately 36.87 degrees, matching the previous example exactly, since it is the same triangle. Angle B, again, is 90 minus 36.87, approximately 53.13 degrees.

Worked example: the hypotenuse and an angle known (a very common real-world combination)

This combination is left out of many basic trigonometry lessons, but it is one of the most common in practice: a ladder's known length leaning at a measured angle, a zip line or a kite string of known length at a known angle of elevation, a ramp of known length at a known incline. Here, neither leg is known at all; only the hypotenuse and one acute angle are.

A guy-wire supporting a pole is 10 feet long and makes a 30 degree angle with the ground. SOH finds the vertical height it reaches: the sine of 30 degrees is the opposite side (the height) over the hypotenuse (the wire), so the height equals 10 times the sine of 30 degrees, 10 times 0.5, exactly 5 feet. CAH finds the horizontal distance from the pole's base to the wire's anchor point: the cosine of 30 degrees is the adjacent side over the hypotenuse, so that distance equals 10 times the cosine of 30 degrees, 10 times approximately 0.866, approximately 8.66 feet. The remaining angle, at the top of the wire, is 90 minus 30, 60 degrees.

In the labeling this article uses, with angle A opposite leg a, that same calculation is leg a equals c times sine of A, and leg b equals c times cosine of A. Applied to the familiar 3-4-5 triangle with c = 5 and angle A = 36.87 degrees, a = 5 times sine of 36.87 degrees, approximately 3, and b = 5 times cosine of 36.87 degrees, approximately 4, recovering the same triangle a third way, this time built outward from the hypotenuse rather than inward from a leg.

a = c sin A b = c cos A

Worked example: a leg and the area known

Occasionally neither an angle nor a second side is available directly, only one leg and the triangle's total area. Since the area of a right triangle is half of leg a times leg b, a known leg and area rearrange directly: leg b equals twice the area divided by leg a.

With leg a = 3 and an area of 6, leg b equals 2 times 6 divided by 3, 12 divided by 3, exactly 4, the 3-4-5 triangle yet again. From there, the Pythagorean theorem and the trig ratios finish the triangle exactly as in the two-legs example above. A known hypotenuse and area, with neither leg given directly, is solvable too, but it needs a small system of two equations solved together rather than one direct rearrangement, since neither leg appears in the problem on its own; there is also a hard limit worth knowing, since the largest possible area for a fixed hypotenuse occurs when the triangle is isosceles, and a requested area larger than that for a given hypotenuse describes a triangle that cannot exist.

Special right triangles: shortcuts that skip the trig entirely

Two particular right triangles show up often enough in geometry and construction that they offer a shortcut for how to solve a right triangle, since their side ratios are worth memorizing outright, skipping SOH-CAH-TOA entirely.

The 45-45-90 triangle, also known as the 45 degree triangle, is half of a square, cut along its diagonal. Its two legs are always equal to each other, and its hypotenuse is always a leg times the square root of 2. Knowing one leg is 5 immediately gives a hypotenuse of 5 times the square root of 2, approximately 7.07, with no sine or cosine needed.

The 30-60-90 triangle is half of an equilateral triangle, cut through one vertex to the midpoint of the opposite side. Its three sides are always in the fixed ratio 1 to the square root of 3 to 2, shortest leg to longer leg to hypotenuse. A shortest leg of 4 immediately gives a longer leg of 4 times the square root of 3, approximately 6.93, and a hypotenuse of 8.

45-45-90: 1 : 1 : √2; 30-60-90: 1 : √3 : 2

The 3-4-5 triangle, used throughout the worked examples above, is not a fixed-angle special case the way the previous two are; the 3-4-5 right triangle angles, approximately 36.87 and 53.13 degrees, are not round numbers. Its usefulness is different: it is the smallest right triangle with three whole-number sides, which makes it the standard example for checking that a real-world corner is actually square, multiplying 3-4-5 up to any convenient scale, 6-8-10, 9-12-15, and comparing a measured diagonal against the predicted one.

Common mistakes when solving a right triangle

A short list of errors accounts for most wrong answers when figuring right triangles. Mixing degrees and radians is the most frequent: a calculator set to radians mode returns a completely different, and completely wrong-looking, number for the same inverse sine or inverse tangent calculation, with no warning that the mode is set incorrectly. A calculator in radians mode reads 30 as 30 radians and returns a tangent of about -6.405, while the intended 30 degrees, which is pi/6 in radians, gives tan pi/6 = 1 divided by the square root of 3, about 0.5774. Confusing which leg is opposite versus adjacent to a given angle is the second most common, since both labels depend on which angle is the current reference point rather than being fixed to one physical side of the triangle. Applying SOH-CAH-TOA or the Pythagorean theorem to a triangle that does not actually have a right angle produces a confident-looking but meaningless number, since neither tool has any validity without that fixed 90 degree angle; a general triangle needs the law of sines or the law of cosines instead. Even those have a trap: the side side angle case can describe two different triangles, one more reason a fixed right angle is so convenient. Finally, forgetting that a right triangle's two acute angles must sum to exactly 90 degrees is an easy way to miss an obvious arithmetic check: if a calculated angle A and a separately calculated angle B do not add up to 90, one of the two calculations has an error somewhere.

Real-world uses for solving a right triangle

Construction relies on right triangle trigonometry constantly: a roof's rafter length, given the building's horizontal run and the roof's pitch angle, is a direct hypotenuse-and-angle problem, and a wheelchair ramp's required length, given a fixed rise and a maximum allowed incline angle, is the same setup. Surveying and navigation use it to convert a measured distance and bearing angle into north-south and east-west components, exactly the sine-and-cosine split used in the guy-wire example above. Physics leans on it for resolving a single force or velocity, described by one magnitude and one angle, into two perpendicular components, again the identical hypotenuse-and-angle calculation with different labels on the sides.

How to solve a right triangle with the calculator

Diagram problems that ask how to find x in a triangle almost always label one side or one angle as x. Decide which of the six known-value pairs the diagram gives you, and the calculator, or the matching formula above, does the rest. That covers how to solve a right triangle for all six common combinations of known values; the right triangle calculator solves all six combinations covered in this article, two legs, a leg and the hypotenuse, a leg and an angle, the hypotenuse and an angle, a leg and the area, and the hypotenuse and the area, and always returns the full picture: every side, both acute angles, the area and the perimeter together. If your triangle does not have a right angle at all, none of the shortcuts in this article apply, and the triangle calculator's law of sines and law of cosines tools are the correct next stop. For the narrower case where a single missing side, and nothing else, is genuinely all that is needed, the Pythagorean theorem calculator does exactly that one calculation with no extra output to sort through.

Frequently asked questions

What does SOH-CAH-TOA stand for?

It is a memory aid for the three basic trig ratios in a right triangle: SOH is Sine equals Opposite over Hypotenuse, CAH is Cosine equals Adjacent over Hypotenuse, and TOA is Tangent equals Opposite over Adjacent. Opposite and adjacent are always defined relative to whichever acute angle is currently being used, not fixed to one particular side of the triangle.

Why doesn't SOH-CAH-TOA work on a triangle that doesn't have a right angle?

The three ratios are only true because a right triangle's hypotenuse is fixed as the side opposite the 90 degree angle, which gives every other side and angle a consistent, unchanging relationship to it. A triangle with no right angle has no such fixed reference side, so none of the three ratios hold, and solving it instead needs the law of sines or the law of cosines, the tools the general triangle calculator uses.

How do I know which trig ratio to use for a given problem?

Identify which two sides, or which side and angle, are already known, and which one is missing, then pick whichever ratio (or the Pythagorean theorem, if both known values are sides) connects them. Two legs and no angle means the Pythagorean theorem. A leg and the hypotenuse means the Pythagorean theorem for the other leg, then sine or cosine for the angle. A leg and an angle usually means tangent, if the other known value is the other leg, or sine and cosine directly if the missing side is the hypotenuse.

Why is the Pythagorean theorem only valid for right triangles?

Its proof relies specifically on the 90 degree angle: a square built on the hypotenuse can be shown, geometrically, to have exactly the same area as the two squares built on the legs added together, and that equality only holds when the angle between the legs is exactly 90 degrees. A triangle with any other angle between its two shorter sides needs the law of cosines instead, which is a generalized version of the same idea that adjusts for whatever the actual angle is.

What is the difference between a right triangle's legs and its hypotenuse, and which does a squared plus b squared equal c squared solve for?

The two legs are the two shorter sides that form the right angle itself, conventionally labeled a and b. The hypotenuse, labeled c, is the longest side, sitting opposite the right angle. The Pythagorean theorem, a squared plus b squared equals c squared, most commonly solves for whichever one of the three is missing when the other two are known, most often the hypotenuse from two legs, or a missing leg from the hypotenuse and the other leg.

How do the special 45-45-90 and 30-60-90 triangles save time?

Both have fixed, memorizable side ratios that skip the trig entirely. A 45-45-90 triangle's two legs are always equal, with the hypotenuse equal to a leg times the square root of 2. A 30-60-90 triangle's shortest leg, longer leg and hypotenuse are always in the ratio 1 to the square root of 3 to 2. Recognizing one of these two special cases means the whole triangle is known from a single side length, no sine, cosine or tangent required.

Can I solve a right triangle if I only know the area and one side, not an angle?

Yes. The area formula, half of leg a times leg b, rearranges directly when one leg is known: the other leg equals twice the area divided by the known leg. Once both legs are known, the Pythagorean theorem finds the hypotenuse and the trig ratios find the angles, exactly as if both legs had been given from the start. A known hypotenuse and area instead of a leg and area is solvable too, though it needs a small system of two equations rather than one direct rearrangement.

Which angle in triangle DEF has the largest measure?

The angle opposite the longest side. To find the angle opposite the longest side, compare the three side lengths: the biggest side always faces the biggest angle, and the smallest side faces the smallest. In a right triangle the answer never changes. The largest angle is the 90 degree right angle, opposite the hypotenuse, because no other angle in a right triangle can reach 90 degrees.

How to find the missing angle of a triangle?

Subtract the angles you know from 180. In a right triangle one angle is already 90, so the two acute angles add up to 90 and the missing one is 90 minus the other. If you know two sides instead of an angle, use an inverse trig function: arcsine of opposite over hypotenuse, arccosine of adjacent over hypotenuse, or arctangent of opposite over adjacent.

What is the altitude of a right triangle?

Usually the height dropped from the right angle to the hypotenuse, which equals the product of the legs divided by the hypotenuse. In the 3-4-5 triangle that is 3 times 4 over 5, or 2.4. Drawing it splits the triangle into two smaller right triangles, each similar to the original, a right triangle in a right triangle twice over. It is also the height of a triangle when the hypotenuse is treated as the base, which gives the same area: half of 5 times 2.4 is 6.

Put this into practice with the free Right Triangle Calculator.