Triangle Calculator

Solve a triangle from three sides, or from two sides and the angle between them.

Leave blank when using two sides + included angle.

The angle between sides a and b (used with sides a and b only).

Result

Area
6
Perimeter
12
Side a
3
Side b
4
Side c
5
Angle A
36.87°
Angle B
53.13°
Angle C
90°
Export:

Two ways to define a triangle

A triangle is fully determined once you fix enough of its parts. This calculator accepts two of the classic combinations: all three side lengths (side-side-side, or SSS), or two sides with the angle that sits between them (side-angle-side, or SAS).

With SSS you give a, b and c. With SAS you give sides a and b plus the included angle C — the corner where those two sides meet. From either starting point every remaining side, angle, the area and the perimeter can be worked out.

The laws that do the work

The engine is the law of cosines, c² = a² + b² − 2·a·b·cos(C). In SAS mode it finds the third side directly; in SSS mode the same law is rearranged to recover each angle from the three sides.

Once two angles are known the third is whatever is left of 180°, since a triangle’s interior angles always sum to a straight line. The area comes from ½·a·b·sin(C), the side-angle-side area formula.

The triangle inequality

Not every set of three lengths forms a triangle. Each side must be shorter than the sum of the other two — otherwise the two shorter sides cannot reach across to close the shape.

If you enter three sides and get an inequality error, check your measurements: one of them is too long relative to the others, or the units are inconsistent.

Reading the results

Angles are reported in degrees and sides in whatever unit you entered. The largest angle always sits opposite the longest side, which is a quick sanity check on the output.

For a triangle that contains a right angle, the dedicated right-triangle and Pythagorean tools are simpler. Use this general solver when no angle is 90°.

Formula

Law of cosines: c² = a² + b² − 2·a·b·cos(C). Area = ½·a·b·sin(C).

Frequently asked questions

Which inputs should I provide?
Either all three sides (a, b, c), or sides a and b together with the included angle C. The angle is ignored when all three sides are given.
Why do I get an error with three sides?
Three lengths form a triangle only if each side is shorter than the sum of the other two (the triangle inequality).