Skip to main content

Triangle Calculator

Solve triangles from SSS, SAS, ASA, AAS, or SSA with full sides, angles, area, and perimeter.

Written by Golam Rabbani, Founder & Lead Engineer

Three sides

Angle unit:

How to use this triangle calculator

  1. Pick the case that matches what you know: SSS (three sides), SAS (two sides + included angle), ASA (two angles + included side), AAS (two angles + non-included side), or SSA (two sides + non-included angle).
  2. Choose degrees or radians for angle input.
  3. Fill in the highlighted side and angle fields — the others are disabled.
  4. Press Calculate. The tool returns all three sides, all three angles, the area, and the perimeter.
  5. For SSA inputs that produce two valid triangles, both solutions are shown side by side and flagged as the ambiguous case.
  6. Use Copy to save the full solution to your clipboard or Reset to clear inputs.

About this triangle calculator

The triangle calculator solves a triangle from any standard combination of sides and angles using the Law of Cosines (for SSS and SAS) and the Law of Sines (for ASA, AAS, and SSA). It then computes the area using ½·a·b·sin C and the perimeter as the sum of all three sides. Every angle output respects the unit you chose at input.

As a worked example, switch to SAS, leave units in degrees, and enter b = 5, c = 7, and the included angle A = 60°. The Law of Cosines gives a² = 5² + 7² − 2·5·7·cos 60° = 25 + 49 − 35 = 39, so a ≈ 6.245. Then sin B = b·sin A / a ≈ 5·0.8660 / 6.245 ≈ 0.6933, so B ≈ 43.90° and C = 180 − 60 − 43.90 ≈ 76.10°. Area = ½·5·7·sin 60° ≈ 15.16 and the perimeter ≈ 18.25.

SSA is flagged explicitly because two valid triangles can satisfy the given data; both are shown so you can pick the one your problem expects.

FAQ

Why is SSA called the ambiguous case?
When you know two sides and an angle opposite one of them, the Law of Sines can produce two possible angles for the other side (B and 180° − B). The tool computes both and labels the result as ambiguous if both are geometrically valid.
What if my three sides cannot form a triangle?
The triangle inequality requires each side to be less than the sum of the other two. If SSS inputs violate this, the tool reports an error instead of returning NaN.
How is the area calculated?
Internally the calculator uses Area = ½·a·b·sin C. For SSS this is equivalent to Heron’s formula but avoids extra rounding by reusing angle C from the Law of Cosines step.
Can I work in radians?
Yes. Toggle the angle unit to radians and all angle inputs and outputs use radians.
What happens if two angles already sum to 180° or more?
No triangle exists. The third angle would be zero or negative, so the tool blocks the calculation and explains the issue.
Is this free to use?
Yes. All math happens locally in your browser. No signup or upload.