Triangle Calculator

Solve any triangle from SSS, SAS, ASA, AAS, or SSA. Enter at least 3 values (including at least 1 side length) then click Calculate. Results are shown when you click Calculate and cleared when you edit a value. Every value you enter is cross-checked, so extra values that contradict the others are reported instead of ignored.

Triangle Input

Angle Unit:

Solving Methods

  • SSS — Law of Cosines to find all angles.
  • SAS — Law of Cosines to find the opposite side, then Law of Sines.
  • ASA / AAS — Third angle = 180° − A − B, then Law of Sines.
  • SSA (ambiguous) — Law of Sines; may yield 0, 1, or 2 solutions.

Tomasz is edging a triangular garden bed whose two straight sides measure 6 m and 9 m with a 40° corner between them, and she needs the third side for the edging and the area for the soil order. This calculator solves a triangle from any three values that include at least one side, covering the SSS, SAS, ASA, AAS and SSA cases.

Law of cosines, law of sines and Heron's formula

Which rule runs depends on what you enter. With three sides (SSS), the law of cosines gives each angle, for example cos A = (b² + c² − a²) / (2bc). With two sides and the angle between them (SAS), c² = a² + b² − 2ab·cos C finds the missing side first. With two angles and a side (ASA or AAS), the third angle is 180° − A − B, then the law of sines, a / sin A = b / sin B = c / sin C, supplies the sides. Two sides plus an angle that is not between them (SSA) also uses the law of sines and can produce zero, one or two triangles.

Once the triangle is known, the area comes from Heron's formula, √(s(s − a)(s − b)(s − c)) with s = (a + b + c) / 2, evaluated in a numerically stable form. Heights are 2 × area / side, medians are ½√(2b² + 2c² − a²) and its two counterparts, the inradius is area / s, and the circumradius is abc / (4 × area). The page also places A at the origin and B on the x-axis, and reports the centroid, incenter and circumcenter in that frame.

Tomasz's bed: side a = 6, side b = 9 and angle C = 40° between them. Then c² = 6² + 9² − 2 × 6 × 9 × cos 40° = 117 − 82.73279986 = 34.26720014, so c = 5.85382. The angles are A = 41.2114° and B = 98.7886°, which with C add up to 180°. Heron's formula gives an area of 17.35527 square metres, matching ½ab·sin C. The perimeter is 20.85382, the inradius 1.66447 and the circumradius 4.55346. Everything is shown to five decimal places, and tiny nonzero values use scientific notation instead of 0.

Every value you type is cross-checked against the solved triangle. If you enter 3, 4 and 5 for the sides and add A = 40°, the page reports that A does not match the other values, which give 36.8699°. Rounded input is tolerated, so A = 36.87 is accepted.

How to Use This Calculator

  1. Choose degrees or radians first. If you switch later, angles you have already typed are converted to the new unit and any old result is cleared.
  2. Side a is opposite angle A, b opposite B and c opposite C, so angle C sits between sides a and b.
  3. Enter at least three values, with at least one of them a side length. Leave the rest blank. Side lengths must lie between 1e-100 and 1e100.
  4. Press Calculate. The results do not update as you type, and editing any box clears the previous result so the numbers on screen always match the inputs.
  5. Read angles, sides, perimeter, semi-perimeter and area in the first cards.
  6. Scroll for heights, medians, radii, vertex coordinates and the three centres.
  7. If two solutions appear, they are labelled as ambiguous SSA, and both are valid triangles.
  8. Use Clear to wipe all six boxes.

Frequently Asked Questions

Why does the calculator sometimes return two triangles?

That is the SSA case, where you know two sides and an angle that is not between them. With A = 30°, a = 5 and b = 8, sin B = 0.8, so B can be 53.1301° or 126.8699°. The first gives c = 9.9282 and the second c = 3.9282, and both fit.

Can I solve a triangle from three angles?

No. Three angles only fix the shape, never the size, so the page says at least one side length must be provided.

I entered angle A with sides a and b. Why is that not treated as SAS?

Because A is opposite a, not between a and b, so it is an SSA problem with a possible second answer. For SAS, the angle must sit between the two sides, which for sides a and b means angle C.

What happens if I switch to radians?

The angles you have already typed are converted for you, so 90 degrees becomes 1.570796327 radians, and the old result is cleared. In radians each angle must be less than π, and a right angle is 1.5708. Typing 90 directly into a radians box is rejected.

Why do 2, 3, 10 and 2, 3, 5 both fail?

Both break the rule that any two sides must add up to more than the third. 2 + 3 is less than 10 outright, and 2 + 3 equals 5, which would make a flat triangle with zero area. The page says no valid triangle exists, because the sum of any two sides must be greater than the third.

What if I enter more values than needed?

The extras are checked, not ignored. If all three sides are entered together with an angle that disagrees, such as 3, 4, 5 with A = 40°, the page tells you which value does not match and what the others imply. Enter only what you know, or fix the mismatch.