Law of cosines calculator

Find a triangle’s third side from two sides and the included angle: c² = a² + b² − 2ab cos C.

Privacy: runs in your browser

This tool processes your input in this browser. Inputs and results are excluded from analytics. Draft saving is optional and stays on this device; delete saved text with the draft controls. Loading text from a URL is optional and contacts that server; its URL and your IP address are visible to the server. When a button sends your result to another tool, it waits in this tab until that tool opens it, for up to a minute, and is then deleted.

Copy link includes the inputs you choose to share in the address. Anyone with that link can reopen them. Files and generated results are excluded. Password and key tools share settings only.

Example: sides of 7 cm and 10 cm with a 50° angle between them. Type your own numbers over it.

More options

Opposite side length

7.68178

More results
Compare with other numbers

Save the current answer, then change an input to compare. This clears when you leave.

Rounding and decimal places

Rounding changes how numbers are shown, not how they are calculated.

Automatic precision rounds answers for reading: up to six significant digits, with whole numbers kept in full. Thousands separators such as 1,000 are accepted; use a dot for decimals.

More
Quick calculator

Use +, −, ×, ÷, parentheses and %. This doesn’t change the tool above.

Keyboard shortcuts

Sharing and starting over

A copied link includes what you entered and your settings, so anyone with it can see them. Leave private text out. Files and results are not included; random draws are made again.

Start over puts the tool back to its starting values and closes any open file or device. Drafts you saved stay on this device until you delete them.

How it works

The angle must sit between the entered sides and be strictly between 0° and 180°. All lengths use one unit. A stable equivalent expression reduces cancellation.

Next: Triangle calculator

Worked example

Two sides of 7 cm and 10 cm with an included angle of 50° give an opposite side of 7.68 cm and a triangle area of 26.81 cm².

How the opposite side length changes with first adjacent side

Other inputs keep their starting values: Second adjacent side: 10; Included angle (degrees): 50. Examples only, not recommendations.

First adjacent sideOpposite side length
3.58.200906
77.681779
1410.771233
Cite this page

ToolOctopus. “Law of cosines calculator.” Updated . https://tooloctopus.com/law-of-cosines-calculator.

Add an access date if your instructions require one.

Citation formatting uses citeproc-js by Frank Bennett and Citation Style Language styles. License and source code.

Find a tool

Type a task, a unit pair, a sum or a time zone. ↓ to choose, Enter to open.