📐Law of Cosines Calculator
Solve triangles using c² = a² + b² − 2ab·cos C, for SAS (find a side) or SSS (find angles).
Free Law of Cosines Calculator
Find a missing side or angle in any triangle with our free Law of Cosines Calculator, using c² = a² + b² − 2ab·cos C. Enter two sides and the included angle (SAS) to find the third side, or all three sides (SSS) to find any angle — with full step-by-step working shown at every stage.
The calculator checks your inputs against the triangle inequality before solving, so invalid triangles are caught immediately with a clear explanation rather than a broken calculation. Area and perimeter are computed automatically, and a scaled diagram illustrates the result.
Whether you're checking homework or solving a real-world triangulation problem, get accurate results with the reasoning shown, not just a bare number. No sign-up, no downloads required.
About the Law of Cosines Calculator
Features
SAS and SSS modes
Solve for a missing side or for any angle, depending on what you know.
Triangle inequality check
Invalid SSS combinations are flagged with a plain-English explanation.
Step-by-step working
See the formula and substitution used for every calculation.
Area, perimeter & diagram
Every solution includes area, perimeter, and a scaled triangle diagram.
Frequently Asked Questions
What is the Law of Cosines?
A formula relating a triangle's sides and one angle: c² = a² + b² − 2ab·cos C, generalizing the Pythagorean theorem.
When do I use SAS mode?
When you know two sides and the angle between them, and want the third side.
When do I use SSS mode?
When you know all three sides and want to find one or more angles.
Does it show the steps?
Yes, the formula substitution and algebra (including the arccos step for SSS) are shown.
What if my sides can't form a triangle?
The triangle inequality is checked first, and invalid combinations are flagged with an explanation.
Does it calculate area?
Yes, via Heron's formula or the ½ab·sinC formula once an angle is known.
Can I use degrees or radians?
Yes, a toggle switches units for all values.
How is this different from the Law of Sines?
Law of Cosines works with SAS/SSS data; Law of Sines is for ASA/AAS/SSA — use whichever matches what you know.
Is it free?
Completely free, no sign-up or limits.
Does it work on mobile?
Yes, fully responsive.