Triangle Calculator

Solve any triangle from three sides, two sides and an angle, or two angles and a side — with all sides, angles, area, perimeter and height.

How to use this calculator

  1. 1Choose which combination of sides and angles you know.
  2. 2Enter them using the same length unit throughout — angles are always in degrees.
  3. 3Angles are labelled to match their opposite side: angle A sits opposite side a.

How the calculation works

Law of cosines: c² = a² + b² − 2ab·cos(C) Law of sines: a/sin(A) = b/sin(B) = c/sin(C) Heron: Area = √(s(s−a)(s−b)(s−c)), s = perimeter/2
a, b, c
Side lengths
A, B, C
The angles opposite sides a, b and c respectively
s
Semi-perimeter — half the perimeter

The law of cosines generalises Pythagoras: when C is 90°, cos(C) is 0 and it reduces to c² = a² + b².

Given three sides, the law of cosines is used rather than the law of sines because arccos is unambiguous over 0–180° while arcsin is not.

SSA is the ambiguous case: two sides and a non-included angle can describe two different triangles, one triangle, or none. The calculator flags when a second solution exists.

Worked example

A triangle with sides 5, 6 and 7

  1. 1.Law of cosines for angle A: cos(A) = (6² + 7² − 5²) ÷ (2 × 6 × 7) = 60 ÷ 84 = 0.7143, so A = 44.415°.
  2. 2.For angle B: cos(B) = (5² + 7² − 6²) ÷ (2 × 5 × 7) = 38 ÷ 70 = 0.5429, so B = 57.122°.
  3. 3.Angle C = 180 − 44.415 − 57.122 = 78.463°.
  4. 4.Heron: s = 9, area = √(9 × 4 × 3 × 2) = √216 = 14.697 cm².

Result: Area 14.697 cm², angles 44.4°, 57.1°, 78.5°

What makes a triangle special

A triangle is the simplest possible closed shape made of straight lines — three sides, three angles, and nothing that can flex. That last property is not just a curiosity: a triangle is the only polygon whose shape is fixed once its side lengths are set. A rectangle built from four hinged rods can rack sideways into a parallelogram, but three rods locked at their ends can only ever form one triangle. Engineers call this rigidity, and it is the reason triangles turn up in bridges, cranes and roof trusses wherever a structure needs to hold its shape under load.

Every triangle, regardless of its size or proportions, shares one fixed fact: its three interior angles always add up to exactly 180 degrees. That single rule underpins almost everything else this calculator computes, from checking that a set of angles is even possible to finding a missing one once two are known.

Classifying triangles

Triangles are usually described two ways at once — by how their sides compare, and by their largest angle.

  • Equilateralall three sides (and all three angles, each exactly 60°) are equal — the most symmetric triangle possible.
  • Isoscelesexactly two sides are equal, and the two angles opposite them are equal too.
  • Scaleneno two sides match, so no two angles match either.
  • Acuteevery angle is under 90°.
  • Rightone angle is exactly 90° — important enough to get its own dedicated calculator, since the Pythagorean theorem only applies here.
  • Obtuseone angle exceeds 90°, which pulls the other two below 45° on average and makes the triangle look "stretched" toward one corner.

Two laws that solve any triangle

Knowing three of a triangle’s six measurements — three sides and three angles — is usually enough to find the other three, provided at least one of the three you know is a side. Two classical results make that possible.

The law of cosines generalises the Pythagorean theorem to triangles that are not right-angled, relating all three sides to one angle between them. The law of sines instead relates every side to the sine of its opposite angle, in a fixed ratio that holds across the whole triangle. Which one applies depends on what you already know — three sides or two sides and the angle between them call for the law of cosines, while two angles and any side call for the law of sines.

Where triangle solving shows up

Solving triangles from partial information is one of the oldest practical applications of mathematics, and it is still exactly how several modern fields measure things that cannot be reached directly.

  • Surveying and land measurementtriangulation finds an unknown distance or position by measuring angles from two known points and solving the triangle between them — the basis of land surveying for centuries.
  • Navigationships and aircraft have long used angle sightings to known landmarks or stars to work out position, solving a triangle in place of a direct measurement.
  • Engineering and constructionroof trusses, bridge supports and cranes are built from triangular sub-structures precisely because a triangle cannot deform without one of its sides changing length.
  • Astronomythe distance to nearby stars is found through parallax — measuring the same star from two points in Earth’s orbit and solving the very long, very thin triangle it forms.

The one case with two answers

Most combinations of three known values pin down exactly one triangle. The exception is two sides and a non-included angle (SSA) — mathematicians call it the ambiguous case, because the same three values can sometimes be swung into two genuinely different triangles, one with an acute version of the missing angle and one with its obtuse supplement. Both satisfy the law of sines equally well, so the calculation alone cannot tell you which one matches your actual situation — only the physical context can. It is one of the few places in geometry where more information does not automatically mean a single answer.

What this assumes, and where it stops

Assumptions

  • A flat, Euclidean plane. Angles are in degrees and sum to exactly 180°.

Limitations

  • The SSA case can have two valid solutions. The calculator reports the acute one and warns when an obtuse alternative also exists.
  • Very thin triangles — where one angle approaches 0° or 180° — lose precision, because arccos is numerically ill-conditioned near its endpoints.
  • Spherical and hyperbolic triangles follow different rules entirely and are not supported.

Common questions

When do I use the law of sines rather than the law of cosines?

Use the law of cosines when you know three sides (SSS) or two sides and the angle between them (SAS). Use the law of sines when you know two angles and any side (ASA or AAS). With two sides and a non-included angle (SSA) the law of sines applies but may give two answers.

Why can three side lengths fail to make a triangle?

Because of the triangle inequality: any two sides must add up to more than the third. Sides of 2, 3 and 9 cannot close — the two shorter sides laid end to end only reach 5, which is not far enough to span the 9. This calculator checks that before attempting to solve.

Formula and content last reviewed on .

Results are estimates for information only, not professional advice.

Report an error

Tools people commonly use alongside the triangle calculator.

See all geometry calculators →