How this triangle calculator works
Every triangle has six parts: three sides (a, b, c) and three angles (A, B, C), where angle A sits opposite side a, B opposite b, and C opposite c. Give this calculator any valid combination of three parts (as long as at least one is a side) and it solves for the other three, then reports the area, the perimeter, and the triangle's classification. More importantly, it shows the working: every law of cosines and law of sines step appears with your actual numbers substituted in, so you can follow the solution line by line or check your own homework against it.
The five buttons describe what you know. SSS means three sides. SAS means two sides and the angle between them. ASA means two angles and the side between them. AAS means two angles and a side that is not between them. SSA means two sides and an angle that is not between them, and that last one is special: it can produce two different valid triangles, and when it does, we show you both.
The formulas
Here a, b, and c are the side lengths, A, B, and C are the angles opposite them in degrees, and s is the semi-perimeter. The square-root area formula is Heron's formula; the (1/2)bc sin A version is handy when you already know two sides and their included angle.
Which law do I use when?
Students often memorize both laws but freeze on which one to reach for. Here is the whole decision in two lines. Use the law of cosines when your known parts do not include a matched side-angle pair: three sides (SSS), or two sides with the included angle (SAS). Use the law of sines as soon as you have any side paired with its opposite angle: ASA and AAS get there instantly via the angle sum, and SSA starts with one pair already in hand.
A useful habit: the law of cosines opens the problem, the law of sines finishes it. In SAS, for example, one law of cosines step finds the missing side; after that you hold a full side-angle pair and the cheaper law of sines (or a second law of cosines, which this calculator prefers because it never gives an ambiguous answer) mops up the remaining angles.
The ambiguous SSA case, explained properly
SSA is the setup teachers warn about and rarely explain. Here is what is actually going on. Suppose you know angle A, its opposite side a, and one more side b. Picture side b fixed in place, hinged at angle A, with side a swinging from the far end like a gate trying to reach the baseline. Three things can happen:
No solution. Side a is too short to reach the baseline at all. Algebraically, the law of sines demands sin B = b sin A / a, and if that comes out greater than 1 there is no such angle, hence no triangle. This calculator tells you exactly that instead of failing silently.
One solution. If a is at least as long as b, the gate can only touch the baseline in one place; the "second" mathematical answer would force the remaining angle below zero. You get a single triangle.
Two solutions. If a is long enough to reach but shorter than b, the swinging side crosses the baseline in two places. Both crossings are legitimate triangles with the same three given measurements. The two versions of angle B are supplements of each other (they add to 180 degrees) because sine treats an angle and its supplement identically. When this happens we solve and display both triangles in full, because picking one silently would simply be wrong half the time.
Worked examples
SSS, sides 3, 4, 5: the inequality holds (3 + 4 > 5). Law of cosines: cos A = (16 + 25 − 9) / (2 × 4 × 5) = 0.8, so A = 36.87°; cos B = (9 + 25 − 16) / (2 × 3 × 5) = 0.6, so B = 53.13°; C = 180 − 36.87 − 53.13 = 90°. Heron: s = 6, area = √(6 × 3 × 2 × 1) = 6. A right scalene triangle, and the classic proof that 3-4-5 earns its reputation.
SAS, b = 8, c = 6, A = 60°: a² = 64 + 36 − 2 × 8 × 6 × cos 60° = 52, so a = 7.21. Then cos B = (52 + 36 − 64) / (2 × 7.21 × 6) gives B = 73.9°, C = 46.1°, and area = (1/2) × 8 × 6 × sin 60° = 20.78.
ASA, A = 30°, B = 70°, c = 10: C = 180 − 30 − 70 = 80°. Law of sines: a = 10 sin 30° / sin 80° = 5.08 and b = 10 sin 70° / sin 80° = 9.54; area = 23.85.
SSA, a = 6, b = 8, A = 40°: sin B = 8 sin 40° / 6 = 0.857. Since a < b, both B = 58.99° and B = 121.01° work, giving two triangles: one with C = 81.01° and c = 9.22, the other with C = 18.99° and c = 3.04. Two honest answers from one set of measurements.
The mistake that quietly ruins triangle homework
The single most common error is solving for a second angle with the law of sines and forgetting that the inverse sine on a calculator only ever returns acute angles. If the triangle's second angle is actually obtuse, the law of sines hands you its acute supplement and everything downstream is wrong, yet every step looks plausible. Two defenses: solve for angles opposite the shorter sides first (they are never obtuse), or do what this calculator does and use the law of cosines for angles whenever the sides are known, since inverse cosine distinguishes acute from obtuse on its own. And always finish with the sanity check that costs nothing: the three angles must total 180 degrees and the longest side must sit opposite the largest angle.