← All text tools

Law of cosines calculator

Find the missing side from two sides and the angle between them, or all three angles from three sides, with every substitution shown and a drawing.

  • Free
  • No sign-up
  • Works on any device

About Law of cosines calculator

The law of cosines, c squared = a squared + b squared - 2ab cos C, solves triangles that the Pythagorean theorem cannot. Use it when you know two sides and the angle between them (SAS) to get the third side, or when you know all three sides (SSS) to get every angle by rearranging it. Each substitution is written out, the area comes from half ab sin C, and a sketch is drawn to scale. With sides 5 and 8 and a 60 degree angle between them, the third side is exactly 7.

How to use Law of cosines calculator

  1. Choose SAS if you know two sides and the angle between them, or SSS if you know all three sides.
  2. Enter the values; angle C sits between sides a and b.
  3. Read the missing side or angles, the working and the scale drawing.

Why use this tool?

Also known as

Frequently asked questions

When should I use the law of cosines and not the law of sines?

Use cosines for SAS and SSS. With those cases the law of sines has no complete ratio to start from.

What happens when the angle is 90 degrees?

The cosine is zero, so the extra term disappears and the formula becomes the Pythagorean theorem c squared = a squared + b squared.

Why do I get an error for some three sides?

Three lengths form a triangle only if each is shorter than the sum of the other two. Otherwise the sides cannot meet.

Is Law of cosines calculator free?

Yes. Law of cosines calculator on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put Law of cosines calculator on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools