Home / Math Calculators / Triangle Calculator

Math & Statistics

Triangle Calculator

Solve a triangle from three sides, or from two sides and the included angle. Get every angle, the area, the perimeter, the type, and a scaled diagram.

Area

24

Right scalene triangle

Angles (A / B / C)—
Sides (a / b / c)—
Perimeter—

Triangle diagram

Drawn to scale from your inputs, with sides and angles labelled.

How it works

Given all three sides, the calculator finds each angle with the law of cosines and the area with Heron's formula. Given two sides and the angle between them, it first finds the third side, then solves the rest the same way.

Law of cosines: cos(A) = (b² + c² − a²) / (2bc)
Heron's area: s = (a+b+c)/2,  Area = √( s(s−a)(s−b)(s−c) )
Third side (SAS): c = √( a² + b² − 2ab·cos C )

Worked example

A 6-8-10 triangle: the semi-perimeter is 12, so the area is √(12·6·4·2) = √576 = 24. Because 6² + 8² = 10², the largest angle is exactly 90°, making it a right triangle.

Worked examples

Three sides (3, 4, 5): the law of cosines gives angles of 36.87°, 53.13° and 90°, so it is a right triangle. Heron's formula: s = (3 + 4 + 5) ÷ 2 = 6, area = √(6 × 3 × 2 × 1) = 6.

Two sides and the included angle (b = 5, c = 7, A = 60°): a² = 5² + 7² − 2 × 5 × 7 × cos 60° = 39, so a = 6.245. The area is ½ × 5 × 7 × sin 60° = 15.155.

Three lengths only form a triangle if each side is shorter than the other two combined; 2, 3 and 6 cannot, because 2 + 3 is less than 6.

Frequently asked questions

How do you find the area from three sides?

Use Heron's formula: semi-perimeter s = (a+b+c)/2, then area = √(s(s−a)(s−b)(s−c)).

How do you find an angle from the sides?

The law of cosines: cos(A) = (b² + c² − a²) / (2bc), then take the inverse cosine.

What makes a valid triangle?

The triangle inequality: any two sides must add up to more than the third.

How do I know if a triangle is right-angled?

If the squares of the two shorter sides add up to the square of the longest (a² + b² = c²), as with 3, 4 and 5.

What is the area of a triangle with sides 5, 6 and 7?

About 14.70, from Heron's formula with s = 9.

Related calculators