Trigonometry

Right Triangle Solver

Enter the two legs of a right triangle. The solver finds the hypotenuse with the Pythagorean theorem, the two acute angles with the arctangent, and the area as half the product of the legs. Angle A is opposite leg a and angle B is opposite leg b.

Right Triangle Solver

Solve a right triangle from its two legs.

Try:
Answerc = 5, A = 36.8699°, B = 53.1301°, area = 6
  1. Legsa = 3, b = 4
  2. Hypotenusec = √(a² + b²) = √(9 + 16) = 5
  3. Angle AA = arctan(a/b) = arctan(0.75) = 36.8699°
  4. Angle BB = 90° − A = 53.1301°
  5. Area½·a·b = 6

A complete triangle from two numbers

Two legs are enough to determine a right triangle completely. Everything else — the third side, both remaining angles, the area — follows from them, which makes this the smallest amount of information that leaves nothing undecided.

This solver takes those two lengths and reports all of it: the hypotenuse from the Pythagorean relation, the two acute angles from the arctangent, and the area as half the product of the legs.

The right angle is already known, so only two acute angles remain, and they are not independent of each other — together with the right angle they must total 180 degrees. That constraint is what turns two side lengths into a fully solved triangle rather than a partially described one.

Reporting the angles alongside the sides is the point of the tool. The Pythagorean relation alone gives lengths; adding the trigonometry converts the same two inputs into a full description, which is what most exercises actually ask for.

How to use this calculator

  1. Enter the first leg Must be positive. The angle reported first is the one opposite it, which is the labelling convention worth keeping straight.
  2. Enter the second leg Also positive. Swapping the two legs swaps the two reported angles and leaves the hypotenuse and area untouched.
  3. Read the hypotenuse first It is computed before the angles and should exceed both legs. Confirming that before reading further catches a mistyped input.
  4. Read the two acute angles Both in degrees, and they must sum to exactly 90. That total is a complete check on the pair.

The formula, and where it comes from

c = √(a² + b²) A = arctan(a/b) B = arctan(b/a) A + B = 90° area = ½·a·b

The hypotenuse comes from the Pythagorean relation, computed with the hypotenuse function rather than by squaring and adding, which keeps precision when the two legs differ greatly in size.

Each acute angle is the arctangent of the ratio of the leg opposite it to the leg beside it. The two are computed independently from their own ratios rather than one being subtracted from 90, though the results necessarily satisfy that relationship — which is what makes their sum a genuine check rather than a tautology.

The tangent is the right function here because both known quantities are legs. Sine and cosine would each need the hypotenuse, so using them would mean computing it first and introducing its rounding into the angles.

The area formula is the general triangle area with the two legs serving as base and height. That substitution works only because they meet at a right angle — for any other triangle the height would have to be found separately.

What each input means

a First leg — form field “Leg a”
One side at the right angle, strictly positive. The first reported angle faces it.
b Second leg — form field “Leg b”
The other side at the right angle, also strictly positive.
c Hypotenuse
Derived, not entered. Always longer than either leg and shorter than their sum.
A, B Acute angles
In degrees, opposite the first and second legs respectively. Their sum is always 90.

Worked examples

Every number below is produced by the same calculation engine the tool above runs. Nothing here is typed by hand, so the walkthrough cannot drift from what you get when you enter the same values yourself.

The 3-4-5 triangle

Legs of 3 and 4. The hypotenuse is a whole number, but the angles are not — which is the usual state of affairs.

Inputs Leg a = 3, Leg b = 4

  1. Legs a = 3, b = 4
  2. Hypotenuse c = √(a² + b²) = √(9 + 16) = 5
  3. Angle A A = arctan(a/b) = arctan(0.75) = 36.8699°
  4. Angle B B = 90° − A = 53.1301°
  5. Area ½·a·b = 6

Result c = 5, A = 36.8699°, B = 53.1301°, area = 6

The hypotenuse comes out as exactly 5, while the two angles are roughly 36.87 and 53.13 degrees. Whole-number sides almost never accompany whole-number angles, and this triangle is the standard illustration of that mismatch.

The smaller angle faces the shorter leg. That correspondence holds in every triangle and is the quickest sanity check on which reported angle belongs where.

An isosceles right triangle

Both legs equal to 5. Equal legs force equal angles, so the answer is determined by symmetry alone.

Inputs Leg a = 5, Leg b = 5

  1. Legs a = 5, b = 5
  2. Hypotenuse c = √(a² + b²) = √(25 + 25) = 7.07107
  3. Angle A A = arctan(a/b) = arctan(1) = 45°
  4. Angle B B = 90° − A = 45°
  5. Area ½·a·b = 12.5

Result c = 7.07107, A = 45°, B = 45°, area = 12.5

Both acute angles come out as 45 degrees, which they must: equal legs face equal angles, and two equal angles summing to 90 leaves no other possibility.

The hypotenuse is 5 times the square root of two, an irrational number shown rounded. Every isosceles right triangle has that same ratio between its hypotenuse and its legs, whatever their size.

Reading the result

The angles must sum to 90

The right angle already accounts for half of the triangle's total, so the two acute angles share what remains. Any pair not summing to 90 indicates an error, which makes this the cheapest available check.

Angles come in degrees

Both are reported in degrees rather than radians. Converting to radians means multiplying by π and dividing by 180, which the angle converter does directly.

Side order and angle order match

The longer leg faces the larger acute angle, and the hypotenuse faces the right angle. Comparing the two orderings confirms the reported angles have been read against the correct sides.

When you would use this

Finding a slope or pitch angle

A rise and a run form the two legs of a right triangle, and the angle between the slope and the horizontal is the arctangent of their ratio. Roof pitch, ramp gradient and incline angle are all this calculation.

Converting components into a magnitude and direction

A quantity given as horizontal and vertical parts has a size equal to the hypotenuse and a direction equal to one of the acute angles, which is exactly what these two inputs produce.

Assumptions and limitations

What this calculator assumes

  • The triangle has a right angle between the two entered sides.
  • Both legs are strictly positive; zero or negative lengths are rejected.
  • Angles are computed from the leg ratios via the arctangent and reported in degrees.
  • The area uses the two legs as base and height, which is valid because they are perpendicular.

Where it stops being the right tool

  • Two legs only. A leg and the hypotenuse, or a side and an angle, are different configurations this tool does not accept.
  • Right triangles only: a general triangle needs the law of sines or cosines.
  • Degrees only, with no radian option for the reported angles.
  • The perimeter, inradius and circumradius are not reported.

Common mistakes

Entering the hypotenuse as one of the legs

Why it happens. All three sides are lengths and the fields do not check which is largest. The result is a valid triangle, just not the one you have.

How to avoid it. Enter only the two sides meeting at the right angle. If your known pair includes the hypotenuse, find the missing leg with the Pythagorean solver first.

Inverting the ratio inside the arctangent

Why it happens. Both legs are available and the tangent takes a single ratio, so which goes on top has to be recalled rather than derived. Inverting it gives the other acute angle.

How to avoid it. The angle's own opposite leg goes on top. The two reported angles are the two possible answers, so check which one faces the side you meant.

Halving the hypotenuse into the area

Why it happens. The area formula is half base times height, and the hypotenuse is the most prominent side, so it gets substituted in.

How to avoid it. Use the two legs. They are perpendicular, so each serves as the height for the other — the hypotenuse is neither.

Key terms

Frequently asked questions

How are the angles found?

Each is the arctangent of the ratio of the leg opposite it to the leg beside it. The two are computed independently from their own ratios, and they necessarily sum to 90 degrees, which makes that total a genuine check on the pair.

What if I only know one leg and the hypotenuse?

Find the missing leg with the Pythagorean theorem solver first, then return here with both legs. This tool takes only the two sides at the right angle.

In what units are the angles?

Degrees. To convert to radians, multiply by π and divide by 180, or use the angle converter, which shows the conversion explicitly.

Why use the tangent rather than the sine?

Because both known quantities are legs, and the tangent is the ratio relating exactly those two. Sine and cosine each involve the hypotenuse, so they would require computing it first and would carry its rounding into the angles.