Right triangle calculator
This right triangle calculator solves a right triangle from any two values: two sides, or one side and an acute angle. It returns the missing sides, both acute angles in degrees and radians, the area, perimeter, altitude to the hypotenuse and inradius, explains each step with SOH-CAH-TOA and draws the triangle.
Right triangle calculator: solve from any two values
Right triangle calculator for 30-60-90 and 45-45-90 triangles
How to use the right triangle calculator
Pick what you know from the “You know” menu: two legs, a leg and the hypotenuse, the hypotenuse and an angle, or a leg and an angle. Choose the length unit and enter the values; angles can be typed in degrees or switched to radians. The right triangle calculator then fills in everything else: the missing sides, both acute angles, the area, the perimeter, the altitude to the hypotenuse, the inradius and circumradius, and the sine, cosine and tangent of angle A. The drawing marks the sides it found in orange, and “Show the working” lists every step with the numbers substituted.
The labels follow the usual textbook convention: C is the right angle, the legs are a and b, the hypotenuse is c, and angle A is opposite leg a. If your homework uses other letters, match them by position: the angle you know and the side across from it. The second panel handles the two special right triangles, 30-60-90 and 45-45-90, with exact answers.
SOH-CAH-TOA: the formulas behind the right triangle calculator
For an acute angle of a right triangle, the opposite side is across from the angle, the adjacent side is the leg next to it, and the hypotenuse is the longest side. The three trigonometric ratios link the angle to the sides:
CAH: cos A = adjacent / hypotenuse = b / c
TOA: tan A = opposite / adjacent = a / b
To find an angle from two sides, use the inverse functions: A = sin⁻¹(a/c), cos⁻¹(b/c) or tan⁻¹(a/b). The two acute angles always add up to 90°, so once you know A, B = 90° − A. The OpenStax Algebra and Trigonometry 2e chapter on right triangle trigonometry has more practice with these ratios. The right triangle calculator also uses these formulas:
| Quantity | Formula | Default example (c = 10 cm, A = 35°) |
|---|---|---|
| Legs | a = c·sin A, b = c·cos A | a = 5.73576 cm, b = 8.19152 cm |
| Other angle | B = 90° − A | 55° |
| Area | a·b / 2 | 23.4923 cm² |
| Perimeter | a + b + c | 23.9273 cm |
| Altitude to the hypotenuse | h = a·b / c | 4.69846 cm |
| Inradius | r = (a + b − c) / 2 | 1.96364 cm |
| Circumradius | R = c / 2 | 5 cm |
The circumradius is half the hypotenuse because the hypotenuse of a right triangle is a diameter of its circumscribed circle (Thales’ theorem). These relations are collected on the Wolfram MathWorld right triangle page.
Worked example with the right triangle calculator
The default values describe a right triangle with hypotenuse c = 10 cm and angle A = 35°. Leg a is opposite A, so SOH gives a = 10 × sin 35° = 10 × 0.573576 = 5.73576 cm. Leg b is adjacent to A, so CAH gives b = 10 × cos 35° = 10 × 0.819152 = 8.19152 cm. The other acute angle is B = 90° − 35° = 55°. The area is 5.73576 × 8.19152 / 2 = 23.4923 cm², the perimeter 23.9273 cm and the altitude to the hypotenuse 5.73576 × 8.19152 / 10 = 4.69846 cm. Check with Pythagoras: 5.73576² + 8.19152² = 32.899 + 67.101 = 100 = 10².
Switch the right triangle calculator to “Two legs a and b” with a = 5 and b = 12: c = 13, A = tan⁻¹(5/12) = 22.6199° and B = 67.3801°. With “Leg a and hypotenuse c”, a = 5 and c = 10 give sin A = 0.5, so A = 30° and the right triangle calculator points out a 30-60-90 triangle.
Special right triangles: 30-60-90 and 45-45-90
Two right triangles appear so often that their sides are worth memorizing. In a 45-45-90 triangle (half a square) the legs are equal and the hypotenuse is a leg times √2. In a 30-60-90 triangle (half an equilateral triangle) the hypotenuse is twice the short leg and the long leg is the short leg times √3. The second panel uses these ratios and keeps the radicals: a short leg of 6 cm gives a long leg of 6√3 ≈ 10.3923 cm, a hypotenuse of 12 cm and an area of 18√3 ≈ 31.1769 cm².
| Triangle | Side ratio | From short leg x | From hypotenuse h |
|---|---|---|---|
| 45-45-90 | 1 : 1 : √2 | hyp. x√2 | legs h√2/2 |
| 30-60-90 | 1 : √3 : 2 | long x√3, hyp. 2x | short h/2, long h√3/2 |
| Angle | sin | cos | tan |
|---|---|---|---|
| 30° | 1/2 | √3/2 ≈ 0.8660 | √3/3 ≈ 0.5774 |
| 45° | √2/2 ≈ 0.7071 | √2/2 ≈ 0.7071 | 1 |
| 60° | √3/2 ≈ 0.8660 | 1/2 | √3 ≈ 1.7321 |
Practical uses of a right triangle calculator
- Roof pitch: a 6/12 roof rises 6 in per 12 in of run, an angle of tan⁻¹(6/12) = 26.57°. In the right triangle calculator, enter a = 6 and b = 12 to also get the rafter length factor, 13.42 per 12 of run.
- Ramps: the ADA slope limit of 1:12 is an angle of only 4.76°; a 30 in rise needs a 360 in (30 ft) run.
- Ladders: the usual 4-to-1 rule puts a ladder at about 75.5° to the ground. A 20 ft ladder at that angle reaches about 19.4 ft up the wall.
- Heights from angles: standing 40 m from a tree and measuring an angle of elevation of 32° gives a height of 40 × tan 32° ≈ 25.0 m above eye level (use “Leg a and the adjacent angle B” with a = 40 and B = 32°).
Common mistakes with a right triangle calculator
Degree and radian mix-ups. sin 35 in radian mode is −0.428, not 0.574. This right triangle calculator takes either unit, but a pocket calculator left in radian mode will silently give wrong answers; check the mode on a Scientific Calculator. Swapping opposite and adjacent. These depend on which angle you are using: the side opposite A is adjacent to B. Using the right angle in SOH-CAH-TOA. The ratios apply to the acute angles only. Rounding too early. Keep at least four significant figures in intermediate steps, or the final Pythagoras check will not close. An angle of 90° or more. The other two angles of a right triangle must be acute; the calculator rejects anything else.
Right triangle calculator or Pythagorean theorem calculator?
If you only need the third side from two sides, or want to test three sides for a right angle, the Pythagorean Theorem Calculator is quicker and gives exact square roots. If the triangle has no right angle at all, use the Triangle Calculator, which applies the law of sines and the law of cosines.
Related calculators
Related tools: the Pythagorean Theorem Calculator for sides only, the Triangle Calculator for any triangle, and all Geometry Calculators.
- Pythagorean Theorem Calculator
- Triangle Calculator
- Area Calculator
- Scientific Calculator
- Square Root Calculator
- Perimeter Calculator
- All geometry calculators
Frequently asked questions
How do I find the angles of a right triangle from two sides?
Use an inverse trig function. With legs a and b, A = tan⁻¹(a/b); with leg a and hypotenuse c, A = sin⁻¹(a/c). Then B = 90° − A. For legs of 5 and 12, the right triangle calculator gives A = 22.62° and B = 67.38°.
How do I find a side from an angle and a side?
Pick the ratio that links the known side and the unknown one. From the hypotenuse c and angle A: a = c·sin A and b = c·cos A. From leg a and angle A: b = a / tan A and c = a / sin A. The right triangle calculator picks the ratio for you and shows it in the steps.
What does SOH-CAH-TOA stand for?
Sine = Opposite / Hypotenuse, Cosine = Adjacent / Hypotenuse, Tangent = Opposite / Adjacent. It is a memory aid for the three trigonometric ratios of an acute angle in a right triangle.
What are the sides of a 30-60-90 triangle?
They are in the ratio 1 : √3 : 2. If the short leg is 6, the long leg is 6√3 ≈ 10.39 and the hypotenuse is 12. The second panel of the right triangle calculator gives exact forms from any one side.
Can I enter the angle in radians?
Yes. Switch the angle unit from ° to rad and type the value; the right triangle calculator converts it and shows every angle in both units.
Is this right triangle calculator free?
Yes. It runs in your browser, needs no sign-up and does not store or send the values you enter.