Triangle Calculator
Solve a triangle from three sides (SSS), two sides and the angle between them (SAS), two angles and a side (ASA or AAS), or two sides and the angle opposite one of them (SSA). For SSA input the calculator works out whether 0, 1 or 2 triangles fit and solves each one.
Enter all three side lengths.
How to use the Triangle Calculator
- Pick the mode that matches what you know: SSS, SAS, ASA, AAS or SSA. Side a is always opposite angle A, b opposite B and c opposite C.
- Enter the three values shown, with angles in degrees. For SSA that is angle A, the side a opposite it, and the second side b.
- Press Calculate. You get the missing sides and angles, the area and the perimeter. If two triangles fit, both appear.
- If the sides are so large that their squares or the area are too big to compute, as with three sides of 1e200, the calculator asks you to enter them in a larger unit instead of showing a wrong answer.
The triangle solver formulas
Law of Sines: a/sin(A) = b/sin(B) = c/sin(C) · · · Law of Cosines: c² = a² + b² − 2ab·cos(C)
Given three of the six sides and angles, including at least one side, these laws plus the angle sum (A + B + C = 180°) determine the rest. Three angles alone fix only the shape, not the size. The five solvable cases are SSS, SAS, ASA, AAS and SSA, and only SSA can be ambiguous.
Worked example
Sides a = 5, b = 7, included angle C = 60°. By Law of Cosines: c² = 5² + 7² − 2·5·7·cos(60°) = 25 + 49 − 35 = 39, so c ≈ 6.24. Then by Law of Sines: A ≈ 43.9°, B ≈ 76.1°. Enter these values in SAS mode above to check.
The SSA ambiguous case: 0, 1 or 2 triangles
SSA means you know two sides and an angle that is not between them. Call the known angle A, the side opposite it a, and the other known side b. The Law of Sines gives sin B = b·sin A / a. A sine value belongs to two angles, B and 180° − B, and that is where the ambiguity comes from.
You can tell how many triangles exist before doing any trig. Work out the height h = b·sin A, the shortest distance from the far end of side b to the line the third side lies on. Side a has to reach that line, so compare a with h and with b.
| Angle A | Condition | Triangles |
|---|---|---|
| Acute (under 90°) | a < h | 0 |
| Acute (under 90°) | a = h | 1 (B = 90°) |
| Acute (under 90°) | h < a < b | 2 |
| Acute (under 90°) | a ≥ b | 1 |
| 90° or more | a ≤ b | 0 |
| 90° or more | a > b | 1 |
Example 1: no triangle (A = 30°, a = 4, b = 10)
h = 10 × sin 30° = 5.00. Side a is 4, shorter than the height, so it never reaches the third side. The Law of Sines says the same thing: sin B = 10 × 0.5 / 4 = 1.25, and no angle has a sine above 1.
Example 2: one triangle (A = 40°, a = 12, b = 8)
h = 8 × sin 40° = 5.14. Side a is longer than b, so only one triangle fits. sin B = 8 × sin 40° / 12 = 0.4285, which gives B = 25.37°. The second candidate, 180° − 25.37° = 154.63°, plus the 40° of angle A already passes 180°, so it drops out.
C = 180° − 40° − 25.37° = 114.63°, and c = 12 × sin 114.63° / sin 40° = 16.97.
Example 3: two triangles (A = 30°, a = 6, b = 10)
h = 10 × sin 30° = 5.00. Side a is 6, which sits between h = 5 and b = 10, so it can swing to two positions. sin B = 10 × 0.5 / 6 = 0.8333, and both B = 56.44° and B = 123.56° leave room for a positive angle C.
Triangle 1 has B = 56.44°, C = 93.56° and c = 11.98.
Triangle 2 has B = 123.56°, C = 26.44° and c = 5.34.
Both are valid triangles. Enter these values in SSA mode above and the calculator lists the two solutions.
For one law at a time, a 90° angle, or just the area, these pages are quicker:
Frequently asked questions
Why is SSA called the ambiguous case?
Two sides and a non-included angle don't always fix one triangle. Depending on the lengths you get no triangle, one, or two different ones. The Law of Sines gives you sin B, and both B and 180° − B have that sine, so each one has to be checked against the 180° angle sum. This calculator runs that check and lists every triangle that fits.
How do you know if SSA has two triangles?
Angle A has to be acute, and side a has to be longer than the height h = b·sin A but shorter than side b. With A = 30°, b = 10 and a = 6, the height is 5. Since 5 < 6 < 10, two triangles exist.
Is SSA a congruence rule?
No. Two triangles can share two sides and a non-included angle and still be different, as Example 3 above shows. The congruence rules are SSS, SAS, ASA and AAS. If a triangle exists at all, SSA pins it down in three cases: A is acute and a ≥ b; a equals the height h, which makes B a right angle; or A is 90° or more and a > b. The hypotenuse-leg (HL) rule for right triangles is one of those cases.
What if side a equals the height exactly?
Then side a meets the third side at a right angle and there is exactly one triangle, with B = 90°. For A = 30°, b = 10 and a = 5, the height is also 5, so B = 90°, C = 60° and c = 8.66.
How do I find a triangle's area?
Area = ½·a·b·sin(C) using two sides and the included angle. Or Heron's formula: Area = √(s(s−a)(s−b)(s−c)) where s is the semi-perimeter.
Do the angles sum to 180°?
In Euclidean (flat) geometry, always. That is why two known angles give you the third: C = 180° − A − B.