Law of Cosines Calculator

Enter any three known values of a triangle — sides a, b, c and/or angles A, B, C — and the Law of Cosines Calculator solves for all remaining sides and angles. Choose your solve mode (SSS or SAS), pick degrees or radians, and get back the missing side or angle, plus the full triangle breakdown including perimeter and area.

Select what you want to calculate based on the values you have.

Results

Calculated Value

--

Angle A

--

Angle B

--

Angle C

--

Side a

--

Side b

--

Side c

--

Perimeter

--

Area

--

Triangle Side Lengths

Frequently Asked Questions

What is the Law of Cosines?

The Law of Cosines is a formula that relates the three sides of a triangle to one of its angles. It states: c² = a² + b² − 2ab·cos(C). It generalizes the Pythagorean theorem to any triangle, not just right triangles, making it useful for solving oblique (non-right) triangles.

When should I use the Law of Cosines?

Use the Law of Cosines when you have either SSS (all three sides known) or SAS (two sides and the included angle known). For ASA, AAS, or most SSA configurations, the Law of Sines is typically the better choice.

When should I use the Law of Cosines vs the Pythagorean theorem?

Use the Pythagorean theorem only when you have a right triangle and need to find a missing side. The Law of Cosines works for any triangle — when the included angle is 90°, it simplifies directly to the Pythagorean theorem since cos(90°) = 0.

Is the Law of Cosines valid only for right triangles?

No — the Law of Cosines works for any triangle, including acute, obtuse, and right triangles. It is specifically designed for cases where the Law of Sines is insufficient, particularly the SSS and SAS cases.

What is the third side of a triangle with sides 5 and 6 and an included angle of 60°?

Using the Law of Cosines: c² = 5² + 6² − 2(5)(6)cos(60°) = 25 + 36 − 30 = 31, so c = √31 ≈ 5.568. Enter these values in the calculator above using SAS mode to verify.

How do I find an angle if I know all three sides (SSS)?

Rearrange the Law of Cosines formula to: A = arccos((b² + c² − a²) / (2bc)). Enter all three side lengths in the calculator with SSS mode selected, and it will compute all three angles automatically.

What units can I use for angles in this calculator?

You can enter angles in either degrees or radians. Select your preferred unit from the Angle Units dropdown before entering values. The results will be displayed in the same unit you selected.

What triangle validity rules apply?

For a valid triangle, all sides must be positive, all angles must be positive, and the sum of any two sides must exceed the third side (triangle inequality). The sum of all interior angles must equal 180° (or π radians). This calculator checks these conditions and warns you if the inputs do not form a valid triangle.

More Math Tools