Skip to content
PercentPoint

Right Triangle Calculator

Solve any right triangle from two values, two sides or a side and an angle, using sine, cosine and tangent. You get all three sides, both acute angles, the trig ratios, the area and the perimeter.

For planning only. Your school, syllabus or accountant has the final word. First published · Last reviewed by PercentPoint.

How to use the right triangle calculator

  1. Say what you know. Pick one of six combinations: a leg and angle A, the hypotenuse and angle A, both legs, or one leg and the hypotenuse.
  2. Enter the two values. Sides can be in any unit; the answers come back in the same unit. Angles are in degrees and must be between 0° and 90°.
  3. Read the solved triangle. The large figure lists sides a, b and c. The cards show both acute angles, sin A, cos A and tan A, the area, the perimeter and the altitude from the right angle to the hypotenuse.

The labels follow the diagram: angle A is at the end of leg b, across from leg a, and the right angle is between the two legs. If your problem names the angle differently, relabel the sides to match before you enter them.

SOH CAH TOA

For an acute angle in a right triangle, the three basic trigonometric ratios compare pairs of sides. OpenStax’s Algebra and Trigonometry 2e (section 7.2) defines them as:

sin A = opposite ÷ hypotenuse = a ÷ c
cos A = adjacent ÷ hypotenuse = b ÷ c
tan A = opposite ÷ adjacent = a ÷ b

The memory aid SOH CAH TOA spells the three ratios: Sine is Opposite over Hypotenuse, Cosine is Adjacent over Hypotenuse, Tangent is Opposite over Adjacent. Which one to use depends on what you know and what you want:

  • Know the opposite side and want the adjacent one, or the reverse: tangent.
  • Know a leg and want the hypotenuse, or the reverse: sine for the opposite leg, cosine for the adjacent leg.
  • Know two sides and want an angle: the inverse function, such as A = tan⁻¹(a ÷ b).

The two acute angles add to 90°, so once you know A, angle B is 90° − A.

Worked examples

A side and an angle (Example 5). A right triangle has a 30° angle with the side opposite it equal to 7. Tangent links the opposite and adjacent sides, so the adjacent side is 7 ÷ tan 30° ≈ 12.1. Sine links the opposite side and the hypotenuse, so the hypotenuse is 7 ÷ sin 30° = 14. Choose “Opposite leg a and angle A” and enter 7 and 30 to check.

Height of a tree (Example 6). Standing 30 feet from a tree, you measure a 57° angle up to the top. The distance along the ground is the side adjacent to the angle, and the height is the opposite side, so height = 30 × tan 57° ≈ 46.2 feet. This is the calculator’s opening example. Add your eye height if you measured the angle standing up.

Two sides (Example 1). With an adjacent side of 15 and a hypotenuse of 17, cos A = 15 ÷ 17 ≈ 0.882, so A ≈ 28.07°. The third side is √(17² − 15²) = 8.

Special right triangles

Two right triangles come up so often that their ratios are worth knowing by heart:

  • 45°-45°-90°: the legs are equal and the hypotenuse is leg × √2. A hypotenuse of 10 gives legs of about 7.0711.
  • 30°-60°-90°: the side opposite 30° is half the hypotenuse, and the side opposite 60° is that short side × √3. A hypotenuse of 14 gives sides of 7 and about 12.12, as in Example 5.

The textbook works these out exactly from side lengths, for example sin 60° = √3 ÷ 2 ≈ 0.866.

Practical uses

  • Heights you can’t reach: trees, flagpoles and buildings, from a distance and an angle of elevation.
  • Ladders: how high a ladder reaches depends on its angle with the ground. For a 20-foot ladder leaning at 75°, choose “Hypotenuse c and angle A” and enter 20 and 75 to get about 19.3 feet of reach and a base about 5.2 feet from the wall.
  • Roof rafters: rise and run give the rafter length and the roof angle.
  • Ramps and slopes: the angle from the rise and run, or the run needed for a given angle. The slope calculator gives grade and the line equation.

Checking your answer

Three quick checks catch most mistakes. The hypotenuse must be the longest side. The larger angle must be across from the longer leg. And a² + b² should equal c², which you can confirm with the Pythagorean theorem calculator.

If a handheld calculator gives strange answers, check that it is in degree mode. In radian mode, tan 57 is about 0.485 instead of 1.54, which would make the tree look about 14.5 feet tall instead of 46.2.

Angles of elevation and depression

Word problems often give the angle of elevation, measured up from the horizontal to something above you, or the angle of depression, measured down from the horizontal to something below you. Both are measured from the horizontal, not from the vertical, so either one goes straight into the calculator as angle A, with the horizontal distance as the adjacent leg b.

For example, from the top of a 100-foot cliff, a boat is seen at an angle of depression of 20°. The cliff height is the side opposite the angle, so the horizontal distance to the boat is 100 ÷ tan 20° ≈ 274.7 feet.

Round only at the end. If you round tan 20° to 0.36 before dividing, the distance comes out 277.8 feet, about 3 feet off. The calculator keeps full precision through every step and rounds only the displayed figures.

Area, perimeter and altitude

Because the two legs meet at a right angle, one leg is the height measured against the other. That makes the area simply half the product of the legs: area = a × b ÷ 2. A 3-4-5 triangle has an area of 6 square units and a perimeter of 12.

The altitude is the perpendicular distance from the right angle to the hypotenuse. Since the area can also be written as c × altitude ÷ 2, the altitude equals a × b ÷ c. For the 3-4-5 triangle, that is 12 ÷ 5 = 2.4. The calculator reports all three values for every solved triangle, which is handy for roof framing, gussets and other cut pieces.

Sources & assumptions

How this calculator gets its numbers. Full method: our methodology.

  • Angle A is opposite leg a and adjacent to leg b; c is the hypotenuse; A + B = 90°.
  • sin A = a ÷ c, cos A = b ÷ c, tan A = a ÷ b; with two sides, the third comes from a² + b² = c² and the angles from inverse tangent.
  • Angles are in degrees.

Sources

  1. OpenStax (Rice University), Algebra and Trigonometry 2e, 7.2 Right Triangle Trigonometry. sin, cos and tan as opposite, adjacent and hypotenuse ratios, with Example 1 (adjacent 15, hypotenuse 17), Example 5 (a 30° angle opposite a side of 7 gives sides of about 12.1 and 14) and Example 6 (a tree measured from 30 ft away at a 57° angle of elevation).
  2. OpenStax (Rice University), Prealgebra 2e, 9.3 Use Properties of Angles, Triangles, and the Pythagorean Theorem. a² + b² = c² for a right triangle, with Example 9.22 (legs 3 and 4, hypotenuse 5), Example 9.23 (leg 5, hypotenuse 13, other leg 12), Example 9.24 (a 10-inch brace with equal legs of about 7.1 inches) and Try It 9.47 (a 13-foot ladder 5 feet from the wall reaches 12 feet).

Last reviewed . Angles measured in the field carry error; a 1° error over a long distance changes the result noticeably.

Frequently asked questions

How do I find a missing side of a right triangle with an angle?

Use sine, cosine or tangent depending on which sides are involved. With angle A and the adjacent leg b, the opposite leg is a = b × tan A; the hypotenuse is c = b ÷ cos A.

How do I find an angle from two sides?

Use the inverse function that matches the sides: A = tan⁻¹(a ÷ b), sin⁻¹(a ÷ c) or cos⁻¹(b ÷ c). With legs 3 and 4, A = tan⁻¹(3 ÷ 4) ≈ 36.87°.

What does SOH CAH TOA mean?

Sine = Opposite ÷ Hypotenuse, Cosine = Adjacent ÷ Hypotenuse, Tangent = Opposite ÷ Adjacent. Opposite and adjacent are relative to the angle you are working with.

What is the difference between this and the Pythagorean theorem calculator?

The Pythagorean theorem needs two sides and gives the third. This calculator also works from one side and one angle, and reports the angles and trig ratios.

Why do I need the angle in degrees?

The calculator takes degrees, the unit most measuring tools use. To convert radians to degrees, multiply by 180 and divide by π.

Can I solve a triangle that has no right angle?

Not with SOH CAH TOA. Triangles without a right angle need the Law of Sines or the Law of Cosines.