Interactive tool
Triangle solver
Enter what you know and the solver returns the rest: every missing side, every missing angle, the area and the perimeter. Right triangles are solved with SOHCAHTOA and the Pythagorean theorem; any other triangle is solved with the law of sines or the law of cosines, whichever your combination of givens allows.
Pick Right triangle and give any two of the sides a, b, c or the acute angles A, B, with the right angle at C. Pick Any triangle and give three values including at least one side. The answer is free every time; the worked steps, which name the law applied at each stage, open once a day and unlimited with Premium.
Right angle at C. Enter any two of a, b, c, A, B (angles in degrees).
Solved triangle
Right Triangle (SOHCAHTOA + Pythagoras)
| a | 3 | A | 36.87° |
| b | 4 | B | 53.13° |
| c | 5 | C | 90° |
| Area | 6 | Perimeter | 12 |
Step by step
See which law was applied and how each unknown was found.
Which law does your triangle need?
A triangle is determined by three independent pieces of information, at least one of which must be a side. Which law solves it depends on whether you already hold an angle together with the side opposite it.
- AAS and ASA, two angles and a side: the third angle is 180 degrees minus the other two, then the law of sines gives both remaining sides.
- SAS, two sides and the angle between them: the law of cosines gives the third side, then the law of sines gives a second angle.
- SSS, all three sides: the law of cosines in its angle form gives the largest angle first, which keeps the remaining work unambiguous.
- SSA, two sides and a non-included angle: the ambiguous case, which can yield two triangles, one, or none.
- Right triangles: no law needed. SOHCAHTOA relates each acute angle to two sides, and the Pythagorean theorem supplies the third side.
The law of sines
In any triangle, each side divided by the sine of the angle opposite it gives the same constant. That makes it the tool of choice whenever you already have one complete angle-and-opposite-side pair.
Law of Sines: a/sin A = b/sin B = c/sin C. In any triangle, each side divided by the sine of its opposite angle gives the same value: a/sin A = b/sin B = c/sin C. Use it for AAS, ASA, and SSA. SSA is the ambiguous case - it can yield two triangles, one, or none, so always check whether a second angle also fits.
Because the sine of an angle equals the sine of its supplement, an angle found this way can have two candidates below 180 degrees. That is the root of the ambiguous case, and it is why the solver checks both and reports two triangles when both survive.
The law of cosines
The law of cosines generalises the Pythagorean theorem to any triangle. When the angle is a right angle its cosine is 0 and the correction term vanishes, leaving the familiar result. Use the side form to find a missing side from SAS, and the angle form to find an angle from SSS.
Law of Cosines for a side: a² = b² + c² − 2bc cos A. a² = b² + c² − 2bc cos A finds the third side from two sides and the angle between them (SAS). It is the Pythagorean theorem with a correction term: when A = 90°, cos A = 0 and it collapses to a² = b² + c².
Law of Cosines for an angle: cos A = (b² + c² − a²)/(2bc). Rearranged for the angle, cos A = (b² + c² − a²)/(2bc) finds any angle from all three sides (SSS). Unlike the Law of Sines it has no ambiguous case: arccos returns a unique angle in [0, π], which is the whole range a triangle angle can occupy.
The ambiguous SSA case
Given sides a and b and the angle A opposite a, compute the height h as b times the sine of A and compare it with a.
- a smaller than h: no triangle exists, because side a cannot reach the base.
- a equal to h: exactly one triangle, and it is right-angled.
- a between h and b: two triangles, one with an acute angle B and one with an obtuse B.
- a at least as long as b: exactly one triangle.
Enter an SSA combination above and the solver labels the acute and the obtuse solution separately rather than silently picking one. The full decision guide works four triangles end to end.
Area and perimeter
The perimeter is the sum of the three sides. The area comes from whichever of these two formulas your givens support, and the solver reports both quantities with every solved triangle.
Triangle area from two sides and the included angle: ½ab sin C. Area = ½ab sin C gives a triangle's area from two sides and the angle between them. It is the familiar ½ × base × height with b sin C standing in for the height. The angle must be the included one - the one between the two sides you used.
Heron's formula: triangle area from three sides. Heron's formula gives the area from the three sides alone: √(s(s−a)(s−b)(s−c)), where s = (a + b + c)/2 is the semiperimeter. No angle is needed, which makes it the one to use for SSS. If any factor comes out negative, the three lengths cannot form a triangle.
Frequently asked questions
What is the least I have to know to solve a triangle?
Three pieces, at least one of which is a side. Three angles fix the shape but not the size, so AAA has infinitely many solutions and the solver will tell you so. For a right triangle the right angle counts as one of the three, which is why two further values are enough there.
When do I use the law of sines and when the law of cosines?
Use the law of sines when you have a matched angle and its opposite side, which is the AAS, ASA and SSA cases. Use the law of cosines when you do not, which is the SSS and SAS cases. After the law of cosines has produced one angle, the law of sines usually finishes the triangle faster.
What is the ambiguous case?
SSA, two sides and an angle that is not between them, can describe two different triangles, exactly one, or none at all. The height h equals b times the sine of A decides it: no triangle when a is less than h, one right triangle when a equals h, two triangles when a lies between h and b, and one triangle when a is at least b. This solver reports both triangles when both exist.
Do I have to enter angles in degrees?
Yes. The angle fields read degrees, and the results are reported in degrees too. To convert, multiply radians by 180 and divide by pi.
How is the area worked out?
From SAS, the area is half the product of two sides and the sine of the angle between them. When only the three sides are known, Heron's formula uses the semiperimeter instead. Both are listed below, and the solver picks whichever fits your input.
Why did the solver reject my numbers?
The most common reasons are a triangle inequality failure, where one side is at least as long as the other two combined, angles that do not add to 180 degrees, or fewer than three values entered. A right-triangle input also has to keep the right angle at C.