Triangle Calculator

Area, perimeter, angles and classification of a triangle from its three sides.

What does this calculator do?

This calculator takes the three side lengths of a triangle and returns everything the sides determine: the area via Heron’s formula, the perimeter, the three interior angles via the law of cosines, and the classification by sides (equilateral, isosceles, scalene) and by angles (acute, right, obtuse). It first checks the triangle inequality — if the sides cannot form a triangle, it says so instead of returning a meaningless number. Use any length unit — as long as every input uses the same one, the results come out in that unit (areas in that unit squared).

Formula

The area uses Heron’s formula on the semiperimeter s; each angle comes from the law of cosines applied to the side opposite it.

s = (a + b + c) ÷ 2
A = √(s(s−a)(s−b)(s−c))
cos(C) = (a² + b² − c²) ÷ 2ab
Triangle diagramA triangle with sides labelled a, b and c and a dashed height h.bach
Diagram not to scale.

How to use it

Enter the three sides in the same unit. The sides must satisfy the triangle inequality: each side shorter than the sum of the other two. The result panel shows the area first, then the perimeter, semiperimeter, the three angles in degrees and both classifications.

Worked example

Sides 3, 4 and 5: s = 6, area = √(6×3×2×1) = 6, perimeter = 12. The angles are 36.87°, 53.13° and 90° — a scalene right triangle (the classic 3-4-5).

Formula version1.0.0
Formulas = (a + b + c) ÷ 2 A = √(s(s−a)(s−b)(s−c)) cos(C) = (a² + b² − c²) ÷ 2ab
Precision4 decimals

Frequently asked questions

Why does it say “invalid triangle”?

The three sides must satisfy the triangle inequality — each side strictly shorter than the sum of the other two. 1, 2 and 5 cannot close into a triangle, so there is nothing to compute.

Which angle is A?

Angles are named after the side they face: angle A is opposite side a, B opposite b, C opposite c. The largest angle always faces the longest side.

How precise are the results?

Results are mathematically calculated from the supplied values and rounded to 4 decimals for display (angles to 2). Internally the math runs at full floating-point precision.

Sources

Related calculators

Last updated: 2026-07-31 · v1.0.0 · Report an error