The short answer: A triangle is determined by three parts, and at least one of them must be a side. With two sides and the angle between them, use the law of cosines: c² = a² + b² − 2ab cos C. With a side and two angles, the law of sines fills in the rest. Three sides go through the law of cosines or Heron’s formula, and the angles always add to 180°.

Key takeaways

  • You need three parts, including a side. Three angles alone fix the shape but not the size.
  • Angles sum to 180°. Find the third angle before reaching for trigonometry whenever two are known.
  • The law of cosines handles SAS and SSS. It is the safe choice because it returns one angle, not two.
  • The law of sines is faster for ASA and AAS. Pair each side with the angle directly opposite it.
  • SSA can produce two triangles. Check whether the supplement of the first angle also fits before trusting the answer.

What a triangle calculator solves

A triangle has six parts: three sides and three angles. Because the angles sum to a fixed 180°, you only need three independent parts, and at least one must be a side. The standard cases are SAS (two sides and the included angle), SSS (three sides), ASA (two angles and the included side), AAS (two angles and a non-included side), and SSA (two sides and a non-included angle).

ASA, AAS, SAS, and valid SSS data each describe exactly one triangle. SSA is the exception: it can produce zero, one, or two triangles, which is why it is called the ambiguous case.

Angles: the 180° rule comes first

In a flat (Euclidean) triangle, A + B + C = 180°. If two angles are 48° and 67°, the third is 65°, and no calculator is needed. Add the three computed angles as a check: if they miss 180° by more than rounding, the pairing is wrong. Angles are reported in degrees, so confirm the calculator is in degree mode before entering 37 rather than 37 radians.

The law of cosines

For a triangle with sides a, b, c and angle C opposite side c:

c² = a² + b² − 2ab cos C

Rearranged to solve for an angle, the same relationship is cos C = (a² + b² − c²) ÷ (2ab). The law of cosines is Pythagoras plus a correction term: when C = 90°, cos C = 0 and the formula collapses to c² = a² + b². When C is obtuse, cos C is negative, so the −2ab cos C term adds length to c.

Use it for two sides and the included angle, or all three sides. It is also the better tool for the largest angle, because inverse cosine is single-valued between 0° and 180°.

Worked example: two sides and the included angle

Suppose a = 7, b = 10, and C = 60°. First find c:

c² = 7² + 10² − 2 × 7 × 10 × cos 60° = 49 + 100 − 140 × 0.5 = 79, so c = √79 ≈ 8.888.

Now find angle A, which is opposite side a: cos A = (b² + c² − a²) ÷ (2bc) = (100 + 79 − 49) ÷ (2 × 10 × 8.888) = 130 ÷ 177.76 ≈ 0.7313, so A ≈ 43.0°. The third angle is B = 180° − 60° − 43.0° = 77.0°. The longest side (b = 10) sits opposite the largest angle (77°), as expected.

The law of sines

For any triangle, a ÷ sin A = b ÷ sin B = c ÷ sin C. With A = 40°, B = 60°, and a = 8, the third angle is C = 80°. Then b = a × sin B ÷ sin A = 8 × 0.8660 ÷ 0.6428 ≈ 10.78, and c = 8 × 0.9848 ÷ 0.6428 ≈ 12.26.

The pairing is the part people get wrong: side a belongs with angle A, the angle across the triangle from it, not with the angle at either end of the side. The law of sines is ideal for ASA and AAS, and it also works for SSA — but there the inverse sine may return only the acute solution when an obtuse one is also valid.

Three sides: the law of cosines and Heron’s formula

With all three sides known, find the largest angle first, since it is the one that can reveal an obtuse triangle. For sides 3, 4, and 5: cos C = (3² + 4² − 5²) ÷ (2 × 3 × 4) = 0 ÷ 24 = 0, so C = 90°. The other angles follow from the law of sines or the same cosine formula, giving 36.87° and 53.13°.

Area comes from Heron’s formula: s = (a + b + c) ÷ 2, then Area = √(s(s − a)(s − b)(s − c)). For sides 5, 6, and 7, s = 9 and Area = √(9 × 4 × 3 × 2) = √216 ≈ 14.70 square units.

The ambiguous SSA case

Take a = 10, b = 12, and A = 40°, with the known angle opposite the shorter known side. The law of sines gives sin B = b sin A ÷ a = 12 × 0.6428 ÷ 10 = 0.7713, so B ≈ 50.5°. But sin(129.5°) is also 0.7713, and 40° + 129.5° = 169.5° is still less than 180°, so a second triangle exists.

The two solutions are B ≈ 50.5° with C ≈ 89.5° and c ≈ 15.56, or B ≈ 129.5° with C ≈ 10.5° and c ≈ 2.83. A calculator that reports only the acute angle silently drops one valid triangle. The rule of thumb: when the known angle is acute and the opposite side is shorter than the other given side, check both B and 180° − B.

Area and the right-triangle special case

When two sides and the included angle are known, Area = ½ × a × b × sin C. For a = 7, b = 10, and C = 60°, the area is ½ × 7 × 10 × 0.8660 ≈ 30.31 square units. This formula explains why area is largest when the included angle is 90°: sin C peaks at 1.

Right triangles are the C = 90° case of everything above. Pythagoras, the sine ratio, and the cosine ratio all follow from the general formulas. The 30-60-90 triangle has sides in the ratio 1 : √3 : 2, and the 45-45-90 triangle has sides in the ratio 1 : 1 : √2.

Common mistakes

  • Leaving the calculator in radian mode and reading 0.6428 as an angle instead of a sine.
  • Pairing a side with the wrong angle in the law of sines; the side and angle must be opposite each other.
  • Reporting only the acute solution in the SSA case and missing the obtuse triangle.
  • Rounding sides to whole numbers midway through, then finding angles that no longer sum to 180°.
  • Accepting side lengths that violate the triangle inequality, such as 2, 3, and 6.
  • Using the law of sines to find the largest angle, where the inverse sine cannot distinguish the true angle from its supplement.

Practical caveats

Measured triangles carry measurement error. A side recorded as 8.0 m has an uncertainty of about ±0.05 m, and an angle read from a protractor is rarely better than ±0.5°. Those inputs propagate: near-degenerate triangles, where one angle is close to 0° or 180°, amplify small side errors into large angle errors, so a thin sliver of a triangle is the least reliable shape to compute.

For layout work, the 3-4-5 triangle is the standard way to establish a right angle on a building site, and checking that the three measured sides satisfy a² + b² = c² is a quick verification. Report angles to one decimal place and sides to the precision of the measurement, and round only at the end rather than at every step.

Frequently asked questions

Can any three lengths form a triangle?

No. The sum of any two sides must exceed the third. Lengths 2, 3, and 6 fail because 2 + 3 < 6, and no arrangement of those segments closes into a triangle.

What if I know two sides and a non-included angle?

That is the SSA case, and it can have zero, one, or two solutions. Compute the angle opposite the second known side, then test whether its supplement also leaves a positive third angle.

Why does the law of cosines give a unique angle?

Because cosine decreases steadily from 1 to −1 as the angle runs from 0° to 180°, so each cosine value maps to exactly one angle in that range. Sine is not one-to-one there, which is why the law of sines can be ambiguous.

How do I find area without the height?

Use Area = ½ab sin C when you have two sides and the included angle, or Heron’s formula when you have all three sides. Both avoid constructing an altitude.

Do the angles of a triangle always add to 180°?

On a flat plane, yes. On a sphere or a curved surface the sum is larger, and in a gravitational field general relativity bends the geometry, but ordinary construction and navigation problems are Euclidean.

Which formula should I try first?

List what you know. Two angles plus any side means the law of sines. Two sides plus the included angle, or three sides, means the law of cosines. Then use the 180° rule for the remaining angle.

Further reading

Keep exploring

Read next Logarithm: Base, Product Rule, and Scale A logarithm is an exponent in disguise. Learn the definition, the product, quotient and power rules, change of… Read next Order of Operations: PEMDAS and Ambiguous Expressions PEMDAS is a shared convention, not a law of mathematics. Learn the real precedence rules, the exponent and… Read next Significant Figures: Counting, Rounding, and Precision Significant figures record how precisely a value was measured. Learn the counting rules, the addition and multiplication rules,…

Decision path

Use this guide in a decision

Open Math Decision Center Open companion solver