331+ free tools. No sign-up. No hidden fees. Explore the toolkit

Law of Sines & Cosines Calculator: Triangles

The law of sines and the law of cosines are the two rules that connect a triangle's sides to its angles. The law of sines says a ÷ sin A = b ÷ sin B = c ÷ sin C — each side is proportional to the sine of its opposite angle. The law of cosines says c² = a² + b² − 2ab·cos C — Pythagoras' theorem with a correction term for the angle between the sides.

Pick the measurements you know — SSS, SAS, ASA, AAS or SSA — and this calculator finds every missing side and angle, plus the area. It handles the ambiguous SSA case properly, listing both triangles when two exist, and tells you plainly when no triangle is possible. If you just need a triangle solved without choosing a trig rule, the triangle calculator takes any three measurements.

Sides are a, b, c; angle A is opposite side a, B opposite b, C opposite c.

Opposite angle A.

Opposite angle B.

Opposite angle C.

Between 0° and 180°.

Between 0° and 180°.

Between 0° and 180°.

Solution

Save to Pinterest
Note: Sides are shown to 4 decimal places and angles to 2. In the SSA case the calculator lists 0, 1 or 2 solutions as the measurements allow — two solutions is a real answer, not an error. Side lengths must be greater than 0 and at most 1,000,000,000.

How It Works

Two rules connect a triangle's sides to its angles. The law of sines says that each side is proportional to the sine of its opposite angle: a ÷ sin A = b ÷ sin B = c ÷ sin C. The law of cosines says c² = a² + b² − 2ab·cos C — Pythagoras' theorem with a correction term for the angle between the sides. When C is 90°, cos C is 0 and the law of cosines becomes c² = a² + b², exactly as Pythagoras says.

Which law you need depends on what you know. With SSS (three sides) the law of cosines finds each angle, rearranged as cos A = (b² + c² − a²) ÷ 2bc. With SAS (two sides and the angle between them) the law of cosines finds the third side directly. With ASA or AAS (two angles and a side) the third angle is 180° − A − B, and the law of sines finds the missing sides. With SSA (two sides and an angle that is not between them) the law of sines finds the second angle — and that is where things get interesting.

SSA is the ambiguous case. Because sin B = sin(180° − B), the law of sines can give two possible values for angle B: an acute angle and its obtuse supplement. Whether there are two solutions, one, or none depends on how side a compares with the height h = b·sin A and with side b: if a is shorter than h there is no triangle; if a equals h there is one right-angled triangle; if a is between h and b there are two triangles; if a is at least b there is one. This calculator works through all of that and lists every valid solution.

The area comes from the same measurements. With two sides and the included angle it is ½ab·sin C; with three sides it is Heron's formula, √(s(s − a)(s − b)(s − c)) where s is half the perimeter. Both give the same answer for the same triangle.

Worked Example

SAS: a = 5, b = 7, C = 60°. By the law of cosines, c² = 25 + 49 − 2 × 5 × 7 × cos 60° = 74 − 35 = 39, so c = 6.2450. The other angles are A = 43.90° and B = 76.10°, and the area is 15.1554.

ASA: A = 30°, B = 60°, c = 10. The third angle is C = 180° − 30° − 60° = 90°, and the law of sines gives a = 10 × sin 30° ÷ sin 90° = 5 and b = 10 × sin 60° ÷ sin 90° = 8.6603.

SSA (two solutions): a = 8, b = 10, A = 30°. The height is h = 10 × sin 30° = 5, and a = 8 is between h and b, so two triangles exist. Solution 1: B = 38.68°, C = 111.32°, c = 14.9053. Solution 2: B = 141.32°, C = 8.68°, c = 2.4153. Both satisfy the law of sines — check either one and a ÷ sin A = b ÷ sin B = 16.

SSS: a = 3, b = 4, c = 5. The triangle inequality holds (3 + 4 > 5), and the law of cosines gives A = 36.87°, B = 53.13° and C = 90° — the familiar 3-4-5 right triangle, with area 6.

Assumptions

Sources: No external data is used on this page — every figure is calculated from the measurements you enter, using the standard law of sines, law of cosines and Heron's formula. Last reviewed: 15 November 2026.

Built and tested by SumKitTool — see how we check our numbers.

How to Use This Calculator

First pick what you know from the dropdown — SSS, SAS, ASA, AAS or SSA — and the form shows only the boxes that mode needs, filled with a worked example. Enter your own measurements and the headline result shows the missing values; the table lists all three sides, all three angles and the area, with the working underneath so you can follow each step.

In SSA mode, watch for the ambiguous case: if two triangles fit your measurements, the calculator shows both, labelled Solution 1 and Solution 2, with a note explaining why. If no triangle fits, it tells you plainly — for example that side a is shorter than the height h = b·sin A — rather than showing an error.

Tips and Practical Advice

Label your triangle before you start: side a is opposite angle A, side b opposite B, side c opposite C. Mixing up which side is opposite which angle is the most common mistake, and it silently gives the wrong answer.

Use the angle sum as a sanity check: the three angles of any triangle add up to exactly 180°. If your two known angles already add up to 180° or more, there is no triangle — the third angle would have to be zero or negative.

For right-angled triangles, Pythagoras and basic trigonometry are quicker than these laws — but the laws still work: try a = 3, b = 4, c = 5 in SSS mode and you get the 3-4-5 triangle with C = 90°. If you only need one side of a right triangle, the Pythagorean theorem calculator is the faster route.

Frequently Asked Questions

When do you use the law of sines and when the law of cosines?

Use the law of sines when you know an angle and its opposite side, plus one more angle or side (ASA, AAS, SSA). Use the law of cosines when you know all three sides (SSS) or two sides and the angle between them (SAS) — it finds the third side or an angle directly.

What is the ambiguous case in the law of sines?

In the SSA case — two sides and an angle that is not between them — the given measurements can fit two different triangles, one, or none. It happens because sin B = sin(180° − B), so an acute angle B and its obtuse supplement both satisfy the law of sines. This calculator lists every valid solution.

How do you find a missing side with the law of cosines?

Use c² = a² + b² − 2ab·cos C, then take the square root. For a = 5, b = 7 and C = 60°, c² = 25 + 49 − 70 × 0.5 = 39, so c = √39 = 6.2450. The law of cosines is Pythagoras' theorem with a correction for the angle.

Can any three side lengths form a triangle?

No — the two shorter sides must add up to more than the longest side. Sides 2, 3 and 10 cannot form a triangle because 2 + 3 = 5 is less than 10; the short sides cannot reach each other. This is the triangle inequality, and this calculator checks it before solving.

Last updated: