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

Classic 3-4-5 right triangle

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

Side a
3
Side b
4
Side c
5
Valid triangle?
Yes
Area
6
Perimeter
12
Angle A
36.87 °
Angle B
53.13 °
Angle C
90 °

Embed this calculator

Copy a free iframe snippet for articles, learning pages, forums, wikis, newsletters, and internal docs.

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, symbols and units

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)
Calculation method explained

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.

Examples

Classic 3-4-5 right triangle3 · 4Yes

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

Side a
3
Side b
4
Side c
5
Valid triangle?
Yes
Equilateral triangle6 · 6Yes

All sides equal at 6 units — all angles should be 60°.

Side a
6
Side b
6
Side c
6
Valid triangle?
Yes
Scalene triangle7 · 10Yes

A general triangle with sides 7, 10, and 12.

Side a
7
Side b
10
Side c
12
Valid triangle?
Yes

Frequently Asked Questions

What 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.
How 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.
When 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.
Can 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.
What 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.

Related Calculators

All calculators