Triangle Calculator

Triangle Calculator
Geometry

Triangle Calculator

Angles are in degrees. Side labels follow the convention that side a is opposite angle A, side b opposite angle B, and side c opposite angle C.
Please enter valid values that form a real triangle (side lengths must satisfy the triangle inequality; angles must sum to less than 180°).
Area
Side a
Side b
Side c
Angle A
Angle B
Angle C
Perimeter
Triangle Type
Disclaimer: This calculator solves triangles using standard trigonometric identities (law of sines, law of cosines, Heron's formula) based on the values you enter. Results are only as accurate as your inputs — double-check measurements for anything used in construction, engineering, or other precision work.

Triangle Calculator: Formulas for Sides, Angles, Area, and Perimeter

Quick summary: A triangle calculator solves for missing sides, angles, area, and perimeter using the Law of Sines, the Law of Cosines, or Heron’s formula, depending on which values you already know. This guide breaks down when to use each formula, walks through worked examples for SSS, SAS, and ASA triangles, and explains the tricky “ambiguous case” that can produce two valid answers.

What Is a Triangle Calculator?

A triangle calculator solves any triangle — right or oblique — by finding missing sides, angles, area, and perimeter from whatever three values you already know. A full-featured triangle calculator can classify a triangle by side lengths and by angles (scalene, isosceles, equilateral, acute, right, or obtuse), and can compute the perimeter, area, and even the altitude to each of its three sides.

Which formula the calculator reaches for depends entirely on what information you’re starting with — that’s the part that trips up most people trying to solve a triangle by hand.

Choosing the Right Formula

There are three classic ways to solve a triangle, and picking the right one depends on your known values:

  • Right triangles: Use the Pythagorean theorem and basic trig ratios (sine, cosine, tangent).
  • SSS (three sides known): Use the Law of Cosines to find the angles, then Heron’s formula for the area.
  • SAS (two sides + the included angle): Use the Law of Cosines to find the missing side, then the Law of Sines or Cosines to find the remaining angles.
  • ASA / AAS (two angles + a side): Use the triangle angle sum (180°) and the Law of Sines.
  • SSA (two sides + a non-included angle): This is the “ambiguous case” — it can produce no triangle, one triangle, or two possible triangles, and needs to be checked directly.

As a simple rule of thumb: if you have SSS or SAS, start with the Law of Cosines; if you have ASA, AAS, or most SSA problems, start with the Law of Sines.

The Law of Cosines

The Law of Cosines generalizes the Pythagorean theorem to any triangle, not just right triangles. It connects three sides and the angle included between two of them:

c² = a² + b² − 2ab·cos(C)

Rearranged, it can also solve for any angle when all three sides are known:

α = arccos[(b² + c² − a²) / (2bc)]
β = arccos[(a² + c² − b²) / (2ac)]
γ = arccos[(a² + b² − c²) / (2ab)]

The Law of Sines

The Law of Sines states that the ratio of a triangle’s side length to the sine of its opposite angle is constant across all three sides:

a / sin(A) = b / sin(B) = c / sin(C)

This makes it possible to find an unknown side or angle whenever you already know one complete side-angle pair, plus one more piece of information.

Area Formulas

A triangle calculator typically supports three different area formulas depending on what you know:

Base and height:

Area = ½ × base × height

Two sides and the included angle (SAS):

Area = ½ab·sin(C)

Heron’s formula (all three sides, SSS):

s = (a + b + c) / 2        (the semi-perimeter)
Area = √[s(s − a)(s − b)(s − c)]

Worked Example 1: Solving SSS with the Law of Cosines

A triangle has sides a = 3, b = 5, c = 6. Find angle α (opposite side a).

cos α = (b² + c² − a²) / (2bc)
cos α = (5² + 6² − 3²) / (2 × 5 × 6)
cos α = (25 + 36 − 9) / 60
cos α = 52 / 60 = 0.8667
α = arccos(0.8667) ≈ 29.9°

Result: α ≈ 29.9° (roughly 30°)

Worked Example 2: Area Using Heron’s Formula

Find the area of a triangle with sides a = 13 cm, b = 14 cm, c = 15 cm.

s = (13 + 14 + 15) / 2 = 21
Area = √[21(21−13)(21−14)(21−15)]
Area = √[21 × 8 × 7 × 6]
Area = √7,056
Area = 84 cm²

Result: Area = 84 square centimeters

Worked Example 3: Area Using SAS

Find the area of a triangle where a = 8, b = 5, and the included angle C = 60°.

Area = ½ab·sin(C)
Area = ½(8)(5)sin(60°)
Area = 20 × 0.8660
Area = 17.32

Result: Area ≈ 17.32 square units

Worked Example 4: Solving with the Law of Sines (ASA)

Given angle A = 40°, side a = 9, and angle B = 65°, find side b.

b = a·sin(B) / sin(A)
b = 9 × sin(65°) / sin(40°)
b = 9 × 0.9063 / 0.6428
b ≈ 12.68

Result: b ≈ 12.68. As a quick sanity check: since angle B is bigger than angle A, side b should be bigger than side a — and it is.

The Ambiguous Case (SSA)

SSA — two known sides and a non-included angle — is the one configuration where the Law of Sines can return two different valid triangles, one valid triangle, or none at all. This happens because sin(θ) = sin(180° − θ), meaning an inverse sine calculation can produce a second valid angle solution that solving in reverse from the Law of Cosines wouldn’t reveal directly. Because of this ambiguity, many calculators deliberately don’t support SSS-style direct solving for SSA and instead test each possible angle to report whether zero, one, or two triangles are possible.

Common Mistakes When Solving Triangles

  • Opposite-pair mismatch — accidentally pairing side a with angle B instead of its actual opposite angle A.
  • Forgetting the second SSA solution — missing the 180° − θ alternative angle that the ambiguous case can produce.
  • Degrees vs. radians — entering degrees while a calculator (or spreadsheet function) is set to radians, or vice versa.
  • Rounding errors near arccos boundaries — floating-point rounding can occasionally produce values just outside the valid −1 to 1 range for arccos, which needs to be clamped before the calculation will work.

Frequently Asked Questions

When should I use the Law of Sines vs. the Law of Cosines?

Use the Law of Cosines when you have SSS or SAS — two sides and the included angle, or all three sides. Use the Law of Sines when you have ASA, AAS, or most SSA problems, where you already know a complete side-angle pair.

What is Heron’s formula used for?

Heron’s formula calculates a triangle’s area directly from its three side lengths (SSS), without needing to know any angle first.

Why does SSA sometimes give two different triangles?

Because the sine function produces the same value for an angle and its supplement (180° minus that angle), a Law of Sines calculation in the SSA case can yield two different valid angles — and therefore two different triangles — depending on the specific side and angle values involved.

How do I find the height of a triangle if I only know the area and base?

Rearrange the base-height area formula: height = 2 × Area ÷ base.

Can a triangle calculator tell me what type of triangle I have?

Yes — most triangle calculators classify a solved triangle by side lengths (scalene, isosceles, equilateral) and by angles (acute, right, or obtuse) automatically.

What’s the difference between a right triangle and an oblique triangle for calculation purposes?

Right triangles can be solved directly with the Pythagorean theorem and basic trig ratios; oblique (non-right) triangles require the Law of Sines or Law of Cosines instead, since the simpler right-triangle formulas don’t apply.

Related Calculators

Conclusion

A triangle calculator’s real value isn’t just crunching the numbers — it’s knowing which formula fits the information you have. Once you know that SSS and SAS problems start with the Law of Cosines, ASA and AAS problems start with the Law of Sines, and Heron’s formula handles area from three sides alone, you can solve almost any triangle by hand and use a calculator to verify — while watching out for the one genuinely tricky scenario, the SSA ambiguous case, where two different triangles can technically satisfy the same given values.