Triangle Solver

Calculate the area, perimeter, and interior angles of any triangle given its three side lengths. Uses Heron's formula for area and the law of cosines for angles.

Examples

The most well-known Pythagorean triple, forming a right triangle.

Valid triangle?
Yes
Area
6
Perimeter
12
Angle A
36.87 °
Angle B
53.13 °
Angle C
90 °

This is a right triangle (one 90° angle).

Was this useful?

Examples

How It Works

Formula

s=a+b+c2s = \frac{a + b + c}{2}

Area=s(sa)(sb)(sc)\text{Area} = \sqrt{s(s-a)(s-b)(s-c)}

cosA=b2+c2a22bc\cos A = \frac{b^2 + c^2 - a^2}{2bc}

Variables

aa

Length of side a

bb

Length of side b

cc

Length of side c

ss

Semi-perimeter (half the perimeter)

AA

Interior angle opposite side a

Area\text{Area}

Triangle area (Heron's formula)

Enter the lengths of all three sides (a, b, c). The calculator first checks the triangle inequality to ensure a valid triangle exists, then computes the semi-perimeter, area via Heron's formula, and all three interior angles using the law of cosines.

The same Law of Cosines pattern gives the other two angles by rotating the sides:

  • cosB=a2+c2b22ac\cos B = \dfrac{a^2 + c^2 - b^2}{2ac}
  • cosC=a2+b2c22ab\cos C = \dfrac{a^2 + b^2 - c^2}{2ab}

In practice the calculator computes A and B from the Law of Cosines and recovers C=180°ABC = 180° - A - B to keep the angle sum exact.

Frequently Asked Questions

01What is Heron's formula?
Heron's formula calculates the area of a triangle when you know all three side lengths. First compute the semi-perimeter s = (a + b + c) / 2, then the area equals √(s(s − a)(s − b)(s − c)). No height measurement is needed.
02How does the law of cosines work?
The law of cosines generalizes the Pythagorean theorem. For a triangle with sides a, b, c, the angle A opposite side a is: cos A = (b² + c² − a²) / (2bc). It works for any triangle, not just right triangles.
03When is a triangle invalid?
A triangle is invalid when any single side is longer than or equal to the sum of the other two sides. This is called the triangle inequality theorem. For example, sides 1, 2, and 5 cannot form a triangle because 1 + 2 < 5.
04Can I use this for right triangles?
Yes. Enter the three sides and the calculator will compute the angles. If one angle is 90°, you have confirmed a right triangle. The 3-4-5 example demonstrates this.
05What units does this calculator use?
The calculator is unit-agnostic — it works with any consistent unit (cm, m, inches, etc.). Just ensure all three sides use the same unit. The area will be in that unit squared.

All calculators