Triangle Solver
Solve a triangle from three sides (SSS), two sides and the included angle (SAS), or two angles and the included side (ASA).
Perimeter 12 · angles sum to 180°.
Give three sides, two sides and their included angle, or two angles and the included side, and the triangle is fully determined. A 3-4-5 triangle is right-angled: its angles are 36.87°, 53.13°, and 90°, its perimeter is 12, and its area is 6 square units by Heron’s formula.
How a triangle is solved
A triangle has six parts — three sides and three angles — and any three of them (as long as one is a side) fix the whole shape. From the given parts the missing sides come from the law of cosines or the law of sines, the missing angles from the same relations, and the area from whichever formula matches the inputs. Angles here are entered and reported in degrees; internally each is converted to radians with rad = deg × π ÷ 180.
law of cosines (rearrange for any angle) and Heron’s formula for area from three sides
Worked example — the 3-4-5 triangle
With sides a = 3, b = 4, c = 5 the triangle inequality holds (each side is shorter than the sum of the other two), so it is solvable:
- 1 Check the triangle is valid. For three sides, confirm each side is shorter than the sum of the other two: 5 < 3 + 4 ✓. For given angles, confirm they are positive and sum to less than 180°.
- 2 Find an angle with the law of cosines. A = acos((b² + c² − a²) ÷ 2bc) = acos((16 + 25 − 9) ÷ 40) = acos(0.8) = 36.87°.
- 3 Find a second angle the same way. B = acos((a² + c² − b²) ÷ 2ac) = acos(18 ÷ 30) = acos(0.6) = 53.13°.
- 4 Close the triangle. C = 180 − A − B = 180 − 36.87 − 53.13 = 90°, so 3-4-5 is right-angled.
- 5 Compute the area. Heron: s = 6, area = √(6 × 3 × 2 × 1) = √36 = 6 square units; perimeter = 3 + 4 + 5 = 12.
Which combinations solve a triangle
Three parts fix a triangle when at least one is a side — except SSA, which can give two answers.
| Given | Meaning | Method | Unique? |
|---|---|---|---|
| SSS | Three sides | Law of cosines for each angle; Heron for area | Yes |
| SAS | Two sides + included angle | Law of cosines for the third side, then angles | Yes |
| ASA | Two angles + included side | Third angle by subtraction; law of sines for sides | Yes |
| AAS | Two angles + a non-included side | Third angle by subtraction; law of sines | Yes |
| SSA | Two sides + a non-included angle | Law of sines | Ambiguous — 0, 1, or 2 triangles |
The ambiguous case and other pitfalls
SSA is the odd one out. When you know two sides and an angle that is not between them, the law of sines can yield two valid triangles, one, or none — because a given sine matches two angles (θ and 180 − θ). That is why this solver sticks to the unambiguous SSS, SAS, and ASA layouts. AAA (three angles) never fixes a triangle at all: it sets the shape but not the size, so infinitely many similar triangles fit.
Keep the inputs consistent — sides must be positive, angles strictly between 0° and 180°, and any two given angles must total less than 180° so the third stays positive. If a set fails these tests the tool flags it rather than returning a nonsensical answer. For a right triangle you can also use the Pythagorean theorem calculator.