Menu

Triangle Calculator

Purpose: Enter three sides to get the triangle's area, perimeter, angles and type (equilateral, isosceles, scalene, right).

Triangle Calculator: How It Works

A triangle is fully determined by three independent measurements, and which three you have decides which method solves it. This calculator handles the standard cases; this page covers how to pick the right one and where the ambiguity lies.

Which case do you have?

KnownMethodSolvable?
SSS — three sidesLaw of cosinesYes, uniquely
SAS — two sides, included angleLaw of cosinesYes, uniquely
ASA / AAS — two angles, one sideLaw of sinesYes, uniquely
SSA — two sides, non-included angleLaw of sinesAmbiguous — 0, 1 or 2 triangles
AAA — three angles—Shape only; size undetermined

The two laws

Law of cosines: c² = a² + b² − 2ab·cos(C)

Law of sines: a ÷ sin(A) = b ÷ sin(B) = c ÷ sin(C)

The law of cosines is a generalisation of Pythagoras. When C is 90°, cos(C) is 0 and the final term vanishes, leaving c² = a² + b².

Area

KnownFormula
Base and height½ × base × height
Two sides and included angle½ab·sin(C)
Three sidesHeron: √[s(s−a)(s−b)(s−c)], s = (a+b+c)÷2

For a triangle with sides 5, 6 and 7: s = 9, so area = √(9 × 4 × 3 × 2) = √216 ≈ 14.7.

The ambiguous case

SSA is the one that catches people. Given two sides and an angle not between them, the shorter side can sometimes swing to meet the base at two different points, producing two valid triangles.

Because sin(θ) = sin(180° − θ), the law of sines returns an angle without telling you whether the true angle is acute or obtuse. Both may be geometrically valid. Always check whether the alternative angle also produces a triangle whose angles sum to 180°, and if it does, report both solutions.

Does a triangle exist?

The triangle inequality: the sum of any two sides must exceed the third. Sides of 2, 3 and 8 cannot form a triangle, because 2 + 3 is less than 8 — the two short sides cannot reach across. If a calculator returns an error or a NaN for three given sides, this is almost always why.

Angles must also sum to exactly 180° in plane geometry. On a sphere they sum to more, which is why great-circle navigation uses spherical trigonometry rather than these formulas.

Practical uses

A note on precision

Check whether your inputs are in degrees or radians before trusting a trigonometric result — this is the single most common error in practice. And when a triangle is very obtuse or nearly degenerate, small measurement errors in the inputs produce disproportionately large errors in the computed values.

Frequently Asked Questions

Which formula should I use?
Law of cosines when you have three sides, or two sides and the angle between them. Law of sines when you have two angles and a side. Three angles alone determine the shape but not the size.
Why does my SSA case give two answers?
Because sin(θ) equals sin(180° − θ), so the law of sines cannot tell an acute angle from its obtuse counterpart. Both may produce a valid triangle. Check whether the alternative still sums to 180° and report both if so.
Why does the calculator reject my three sides?
The triangle inequality: the sum of any two sides must exceed the third. Sides of 2, 3 and 8 cannot close, because the two shorter sides cannot reach across the longest one.
What is Heron's formula for?
Finding the area from three side lengths alone, without needing any angle or height. Compute the semi-perimeter s, then take the square root of s(s−a)(s−b)(s−c).
How is the law of cosines related to Pythagoras?
It generalises it. When the included angle is 90°, its cosine is zero and the correction term disappears, leaving c² = a² + b². Pythagoras is the right-angled special case.
Should I enter angles in degrees or radians?
Match whatever the calculator expects, and check before trusting a result. Mixing the two is the most common source of wrong answers in trigonometry — a result that looks absurd is usually this.

Related Calculators Tools

Browse all Calculators tools →