Skip to content
D DocNectar

Free Law of Cosines Calculator

Find a missing angle from all three sides, or a missing side from two sides and the included angle.

100% Free No Signup Works on all devices

Last updated October 5, 2026 · Report an error

Thanks for rating!

The law of cosines generalizes the Pythagorean theorem to any triangle, not just right triangles — letting you find a missing angle from three known sides, or a missing side from two sides and the angle between them.

This calculator solves either direction of the law of cosines.

How it works

Choose whether you know all three sides or two sides plus the included angle. The calculator applies the appropriate rearrangement of the law of cosines formula to solve for the missing angle or side.

  1. Enter what do you know?.
  2. Enter side a.
  3. Enter side b.
  4. Enter side c (if using all three sides).
  5. Enter included angle C in degrees (if using two sides + angle).
  6. Click Calculate to see your results.

Examples

3-4-5 right triangle

Given sides 3, 4, and 5, the law of cosines finds the angle opposite the side of length 5 to be exactly 90°, confirming this is a right triangle.

Who should use it

  • Finding a triangle's angle from its three side lengths for a trigonometry course.
  • Finding a missing side length from two sides and the angle between them, like in navigation or surveying.

Industry applications

  • Trigonometry and mathematics education
  • Surveying, navigation, and engineering

Advantages

  • Solves both directions of the law of cosines from a single tool.
  • Validates the triangle inequality for the three-sides case.

Limitations

  • Doesn't handle the SSA (two sides + non-included angle) case — that's the law of sines' domain, and is ambiguous in general.

Common mistakes to avoid

  • Trying to use two sides and a NON-included angle (SSA) with this tool — the law of cosines specifically needs the angle between the two given sides, not just any angle.
  • Entering side lengths that violate the triangle inequality, which don't describe any real triangle.

Best practices

  • Use the law of cosines for SAS (two sides + included angle) or SSS (three sides) cases; use the law of sines instead for AAS or ASA cases (two angles known).

Tips

  • The law of cosines works for ANY triangle (acute, right, or obtuse) — unlike some simplified formulas that only work for right triangles, making it one of the most generally useful trigonometric tools.

Frequently asked questions

Yes, with no signup and no limit on how many triangles you solve.
The Triangle Calculator only accepts all three sides (using Heron's formula for area); this calculator can also work the other direction — given two sides and the angle between them — to find the third side, in addition to finding an angle from three sides.
When the included angle is exactly 90°, cos(90°) = 0, and the law of cosines formula c² = a²+b²−2ab·cos(C) simplifies exactly to c² = a²+b² — the Pythagorean theorem is a special case of the law of cosines.
The calculator checks the triangle inequality (any two sides must sum to more than the third) and will reject side lengths that can't actually form a triangle.

Get new calculators and guides in your inbox

No spam — just new tools like Law of Cosines Calculator and practical guides.

Favorites