Advertisement

Free Online Triangle Calculator

Solve triangle sides, angles, area, and perimeter.

What do you know?

All three sides. The sum of any two sides must exceed the third.

Two sides and the angle between them, in degrees.

Two angles and the side between them. AAS works too: enter the side opposite the third angle.

A right triangle with legs a and b. The right angle is C = 90°.

Sides use no unit here, so any consistent unit works. Angles are always returned in degrees.

Triangle type
—
—
Side a
—
Opposite angle A
Side b
—
Opposite angle B
Side c
—
Opposite angle C
Angle A
—
Degrees
Angle B
—
Degrees
Angle C
—
Degrees
Area
—
Heron’s formula
Perimeter
—
a + b + c

Step-by-step working

  1. Choose a mode and enter the known values.
Advertisement

About the Triangle Calculator

A triangle is fixed once you know enough of its sides and angles. This calculator supports four common cases: three sides (SSS), two sides with the included angle (SAS), two angles with a side (ASA or AAS), and a right triangle with two legs. It uses the law of cosines and the law of sines, then reports every side, every angle, the area, and the perimeter. Impossible combinations are rejected with an explanation instead of a silent wrong answer.

The four input modes

  • SSS: all three sides. The law of cosines gives each angle. The three sides must satisfy the triangle inequality.
  • SAS: two sides and the angle between them. The law of cosines finds the third side, then the remaining angles.
  • ASA / AAS: two angles and one side. The third angle comes from the 180-degree sum, then the law of sines finds the other sides.
  • Right: two legs. The Pythagorean theorem supplies the hypotenuse and basic trigonometry supplies the acute angles.

Law of cosines and law of sines

The law of cosines generalises the Pythagorean theorem: c² = a² + b² − 2ab cos C. It works for any triangle and is the safest way to find an angle from three sides, because the inverse cosine returns a value between 0 and 180 degrees. The law of sines states that a / sin A = b / sin B = c / sin C. It is ideal when a matching side and angle are known, but it can be ambiguous in some configurations, so this tool uses the law of cosines whenever three sides are available.

Area with Heron's formula

Heron's formula computes area from the three sides alone. First find the semi-perimeter s = (a + b + c) / 2, then evaluate Area = √(s(s − a)(s − b)(s − c)). The expression under the square root is positive for every valid triangle and becomes zero only in the degenerate case where the three points lie on a straight line. The calculator clamps tiny negative rounding errors to zero before taking the square root.

Rejecting impossible triangles

Three lengths form a triangle only if each one is shorter than the sum of the other two. For example, 2, 3, and 8 cannot meet because 2 + 3 is only 5. Angles must be positive, and two angles must sum to less than 180 degrees so that the third angle remains positive. For SAS, the included angle must also be strictly between 0 and 180 degrees. These checks happen before any trigonometry, which prevents misleading output from invalid input.

Frequently asked questions

Why can SSS produce a unique triangle?

Three side lengths that satisfy the triangle inequality determine a single shape up to reflection. The angles are fixed by the law of cosines, so no other combination is possible.

What is the difference between ASA and AAS?

ASA places the known side between the two known angles. AAS places it opposite one of them. In both cases the third angle is 180 degrees minus the other two, and the law of sines finds the remaining sides.

Why are the angles rounded?

Trigonometric results are usually irrational. The calculator keeps full precision internally and rounds only for display, so small differences in the last decimal place are normal.

Sponsored
Find a bug? Report now