How to Solve a Right Triangle: SOH-CAH-TOA and the Pythagorean Theorem
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.
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.
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.
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.
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.