Triangle Calculator

About this calculator

The Triangle Calculator solves any triangle from three known values, as long as at least one of them is a side. Enter sides a, b, c and angles A, B, C in any combination (SSS, SAS, ASA, AAS or SSA) and get the remaining sides and angles, plus the area, perimeter, semiperimeter, heights, medians, inradius, circumradius and triangle type.

When two different triangles fit your numbers (the ambiguous SSA case) both solutions are shown. Angles can be entered in degrees or radians, and radian fields accept expressions such as pi/4.

Sides
Angles
Angle unit
Radian inputs accept expressions like pi/3.
Embed this calculator

Paste this code into a Custom HTML block on your site. The calculator fits the width of the block. Adjust the height in the code if you want more room for results.

Find this widget in the publisher directory

How to solve a triangle

A triangle has six basic measurements: three sides (a, b, c) and three angles (A, B, C). By convention each angle takes the capital letter of the side across from it, so angle A sits opposite side a. Knowing any three of the six, with at least one side among them, is usually enough to find the other three. Three angles alone are not enough, because they describe the shape without fixing the size: a small and a large equilateral triangle share the same angles.

The calculator recognizes the five standard cases and picks the right tool for each:

  • SSS (three sides): angles come from the law of cosines.
  • SAS (two sides and the angle between them): the third side comes from the law of cosines.
  • ASA and AAS (two angles and one side): the third angle is 180° minus the other two, then the law of sines gives the missing sides.
  • SSA (two sides and an angle that is not between them): the law of sines gives a second angle, and there may be zero, one or two valid triangles.

The law of sines and the law of cosines

Law of sines: a / sin A = b / sin B = c / sin C = 2R
Law of cosines: c² = a² + b² − 2ab · cos C

The law of cosines is a generalization of the Pythagorean theorem. When C is 90°, cos C is zero and the formula collapses to c² = a² + b². The law of sines links each side to the sine of its opposite angle, and the common ratio equals the diameter of the circumscribed circle.

The ambiguous case (SSA)

When you know sides a and b and angle A, the law of sines gives sin B = b · sin A / a. Because two angles between 0° and 180° share the same sine (B and 180° − B), the data may fit two different triangles. If sin B is greater than 1, no triangle exists. If the obtuse candidate makes the angle sum reach 180°, only one triangle exists. Otherwise both are valid, and the calculator lists each one separately.

Worked example

Suppose a = 6, b = 5 and the angle between them is C = 60°. The law of cosines gives c² = 36 + 25 − 2 · 6 · 5 · cos 60° = 61 − 30 = 31, so c ≈ 5.56776. The area is ½ · 6 · 5 · sin 60° ≈ 12.99038, the perimeter is about 16.56776, and the semiperimeter is half of that, about 8.28388. Applying the law of cosines again gives A ≈ 68.948° and B ≈ 51.052°, so the largest angle is under 90° and the sides are all different: an acute scalene triangle.

Area of a triangle

There are several equivalent ways to find the area, depending on what you know:

  • Base and height: Area = ½ · base · height.
  • Two sides and the included angle: Area = ½ · a · b · sin C.
  • Three sides (Heron's formula): Area = √(s(s − a)(s − b)(s − c)), where s = (a + b + c) / 2.

For a 3, 4, 5 triangle, s = 6 and Heron's formula gives √(6 · 3 · 2 · 1) = 6, the same result as ½ · 3 · 4.

Heights, medians, inradius and circumradius

A height (altitude) is the perpendicular distance from a vertex to the line containing the opposite side, so ha = 2 · Area / a. A median joins a vertex to the midpoint of the opposite side; the three medians meet at the centroid, the triangle's balance point. Their lengths follow from Apollonius's theorem: ma = ½ √(2b² + 2c² − a²).

The inradius r is the radius of the largest circle that fits inside the triangle, touching all three sides. It equals the area divided by the semiperimeter. The circumradius R is the radius of the circle through all three vertices, equal to a / (2 sin A) or, equivalently, abc / (4 · Area).

Types of triangles

By sidesMeaning
EquilateralAll three sides equal, every angle 60°
IsoscelesTwo sides equal, and the angles opposite them equal
ScaleneAll sides different
By anglesMeaning
AcuteAll angles below 90°
RightOne angle exactly 90°
ObtuseOne angle above 90°

Tips for accurate results

Keep units consistent: all sides must use the same length unit, and the area comes out in that unit squared. Results are rounded for display, so if you copy a computed side back into the form, expect tiny differences in the last digit. The coordinate table places vertex A at the origin and vertex B on the positive x-axis, which makes it easy to redraw the triangle on graph paper or in CAD software.

Frequently asked questions

What is the minimum information needed to solve a triangle?
Any three of the six measurements, as long as at least one is a side. Three angles alone only fix the shape, not the size.
Why does the calculator sometimes show two triangles?
With two sides and a non-included angle (SSA), the law of sines can give an acute and an obtuse solution for the unknown angle. When both keep the angle sum under 180°, two different triangles fit the data.
How do I find the area of a triangle with three sides?
Use Heron's formula: compute s = (a + b + c) / 2, then Area = √(s(s − a)(s − b)(s − c)).
Can I enter angles in radians?
Yes. Switch the angle unit to radians. You can type decimals or expressions such as pi/3 or 2pi/5.

Formulas and sample results on this page were checked against independent references. Page last reviewed or updated . How we verify calculators. Project led by Shaun Connell.