Tools · Math & Statistics

Triangle Solver

Give it the three measurements that fix a triangle and it returns the other three, with the area, the perimeter, the inradius and circumradius, and what kind of triangle you have. Six ways in: three sides, two sides and an angle, two angles and a side — either the one between them or the one that isn’t — or two lengths of a right triangle. The one combination that can mean two different triangles, SSA, shows both and explains why. Angles work in degrees or radians, your choice.

Refuses number sets that are not trianglesHow it worksInputs stay on this device
Your inputs

Three sides

Four of these fix exactly one triangle. The fifth — SSA, two sides and an angle that is not between them — sometimes fixes two, and this tool shows both when it does.

Any of the three sides. The letters are only labels — a, b and c can be entered in any order.

The second side. Lengths carry no units here: whatever you put in comes back out.

The third side. It cannot be longer than the other two put together.

Advanced options

Switches how every angle above is typed and how every angle in the result is shown. Flipping it converts the numbers already entered, so the triangle itself does not change.

Your inputs are calculated locally and are not stored.
Area6

A scalene right triangle. Sides of 3, 4 and 5 meet at 36.87°, 53.13° and 90°, enclosing an area of 6 inside a perimeter of 12.

Side a
3
Side b
4
Side c
5
Perimeter
12
Area
6
Inradius
1
Circumradius
2.5
Shape
scalene and right
Each vertex, the angle there, and the side across from it
VertexAngleOpposite side
A36.87°a = 3
B53.13°b = 4
C90°c = 5
  • The three angles are printed so they total exactly 180°. Two are computed and the third is what is left of a half turn, because three independent arc-cosines do not add up cleanly in binary arithmetic.
  • Lengths carry no units. Enter centimetres and the perimeter is in centimetres and the area in square centimetres — the arithmetic never needs to know which.
  • Angles are rounded to a hundredth of a degree and lengths to four decimals, and the shape is named from those rounded figures, so the label always agrees with the numbers beside it.
Formula & methodology

Three laws, and knowing which applies

A triangle has six parts — three sides and three angles — and any three of them, with one exception, determine the rest. Which law does the work depends on which three you have.

c² = a² + b² − 2ab·cos C  •  a ÷ sin A = c ÷ sin C  •  Area = √(s(s−a)(s−b)(s−c))  •  r = Area ÷ s  •  R = abc ÷ (4 × Area)
a, b, c
The three sides, each named for the angle opposite it
A, B, C
The angles at the three vertices, in degrees or radians
s
The semi-perimeter, (a + b + c) ÷ 2
r, R
The inradius and circumradius — the radii of the circle inside the triangle and the circle through its vertices

The law of cosineshandles both modes that start from sides. Rearranged as cos A = (b² + c² − a²) ÷ 2bc it turns three sides into an angle; left as written it turns two sides and the angle between them into the third side. Pythagoras is the same law with C set to 90°: cos 90° is 0, the last term vanishes, and c² = a² + b² is what is left. There is only one law here, and the right-triangle case is its easiest instance.

The law of sines handles the modes that start from angles. Two angles fix the third by subtraction, and each side is then the known side scaled by the ratio of two sines. ASA and AAS are the same computation reached from two starting points: ASA scales from the side between the two angles, AAS from the side opposite one of them — either way, one side and its opposite angle fix the ratio the other two sides obey.

SSA uses the law of sines too, but is not always a single computation. It solves for the angle opposite the second given side, and because sine is positive for both an acute angle and its obtuse supplement, that step can have one answer or two. This page solves both whenever both are real triangles, rather than reporting one and leaving the other undiscovered — see the ambiguous case below.

For area, Heron’s formulais used when all three sides are known, because half base times height needs a height and the height is rarely one of the numbers you have. In the other three modes ½ab·sin C is exact and quicker. Heron is applied in W. Kahan’s rearrangement, which sorts the sides before multiplying: the textbook form loses about half its significant digits on a long thin sliver, where the semi-perimeter and the longest side agree to many decimal places before they differ.

Two more lengths come from the same sides and area, with no further trigonometry needed. The inradius — the radius of the circle tangent to all three sides — is the area divided by the semi-perimeter: r = Area ÷ s. The circumradius— the radius of the circle through all three vertices — is R = (a × b × c) ÷ (4 × Area). Both are computed from the triangle’s exact, unrounded sides and area rather than the rounded figures printed on the page, so a razor-thin triangle whose displayed area rounds to a very small number can never turn either radius into a division by zero.

The rule behind the rejections

Two sides have to out-reach the third

Ask for a triangle with sides of 3, 4 and 9 and this page refuses, and the reason is worth seeing once because it makes the rule obvious forever. Lay the 3 and the 4 flat along the 9, end to end. Together they cover 7 of it and leave a gap of 2. Now lift the joint between them to try to close the triangle: every degree you bend brings their far ends closer together, not further apart. Straight was as far as they could ever reach, and straight was not far enough.

That is the whole triangle inequality — any two sides, laid end to end, must be longer than the third — and it has to hold for all three pairs, not just the obvious one. Euclid proves it as Proposition 20 of Book I of the Elements, where it is sometimes dismissed as the fact a donkey knows, since a donkey walking to a pile of hay takes the direct route rather than two sides of a triangle.

The equality case is refused too. Sides of 3, 4 and 7 do meet, but only by lying flat in a straight line: no height, no area, and no angles worth reporting. Returning “area 0” for that would be technically true and practically a bug, so it is named as a failed inequality instead.

Worked example

The 3-4-5, from three sides to six parts

Start with sides a = 3, b = 4, c = 5. For the angle at A, the law of cosines gives cos A = (4² + 5² − 3²) ÷ (2 × 4 × 5) = 32 ÷ 40 = 0.8, and the angle whose cosine is 0.8 is 36.87°. For B: cos B = (3² + 5² − 4²) ÷ (2 × 3 × 5) = 18 ÷ 30 = 0.6, giving 53.13°. The third angle is what is left of a half turn: 180 − 36.87 − 53.13 = 90°, which is why the ratio 3∶4∶5 squares a corner on a building site with nothing but a tape measure.

For the area, the semi-perimeter is (3 + 4 + 5) ÷ 2 = 6, and Heron’s formula gives √(6 × 3 × 2 × 1) = √36 = 6. Check it against the right angle: ½ × 3 × 4 = 6. The perimeter is 12, the sides are all different so the triangle is scalene, and the largest angle is exactly 90° so it is right.

Switch to two sides and the angle between them and the same machinery runs the other way. Sides of 5 and 7 with 60° between them give c² = 25 + 49 − 2 × 5 × 7 × cos 60° = 74 − 35 = 39, so the third side is √39 = 6.245. The area is ½ × 5 × 7 × sin 60° = 15.1554, and the remaining angles come back as 43.90° and 76.10° — which, with the 60° you supplied, add to exactly 180.

The 3-4-5 also shows the two new radii cleanly. Its semi-perimeter is 6 and its area is 6, so the inradius is 6 ÷ 6 = 1. Its circumradius is (3 × 4 × 5) ÷ (4 × 6) = 60 ÷ 24 = 2.5 — exactly half the hypotenuse, which is always true for a right triangle, since the hypotenuse is a diameter of the circle through all three vertices. Switch the angle unit to radians and the same triangle’s angles print as 0.6435, 0.9273 and 1.5708 instead of 36.87°, 53.13° and 90° — the sides, the area, and both radii are untouched, because only the angle fields carry a unit at all.

The one case with two answers

SSA, and how this calculator handles being ambiguous

Three sides fix a triangle. Two sides and the angle betweenthem fix a triangle. Two angles and a side, whether it sits between them or not, fix a triangle. Those are SSS, SAS and ASA — three of Euclid’s congruence criteria — plus AAS, which follows from ASA the moment you notice that two known angles hand you the third for free. Two sides and an angle that is not between them — SSA — is the exception: it can fix one triangle, two triangles, or none, depending on the numbers.

Here is why. Draw the known angle, and run one known side out along one of its arms. Now place the second known side so that it reaches from the far end of the first back down to the other arm. Think of it as a compass: put the point at the end of the first side, open it to the length of the second, and sweep. If the second side is shorter than the first, that arc crosses the arm twice, and both crossings are real triangles.

With sides of 5 and 7 and a 40° angle opposite the 5, the two answers are a triangle with angles 40°, 64.15° and 75.85° and a third side of 7.5428, and a triangle with angles 40°, 115.85° and 24.15° and a third side of 3.1819. Their areas are 16.97 and 7.16. These are not near-misses of each other; they are different triangles that satisfy the same three numbers. Choose SSA above and enter exactly these — angle A = 40, side a = 5, side b = 7 — and both appear, clearly labelled, with the reason spelled out in the result panel. When the numbers admit only one triangle, or none, this calculator says which and why instead of guessing.

Assumptions

What this calculator assumes

  • The triangle is flat. Angles sum to 180° only in plane geometry. On a sphere they sum to more, which is why a triangle drawn on the Earth with long enough sides does not behave like this one.
  • Lengths carry no units. Enter centimetres and the perimeter, area, inradius and circumradius are all in centimetres (or square centimetres for area). Mixing units within one triangle silently produces nonsense, because nothing here can tell.
  • Degrees by default, radians on request. The advanced options include a toggle that switches every angle field, in and out, between the two. Flipping it converts whatever is already typed, so a triangle you have built does not change shape — only the unit its angles are measured in does.
  • AAS and SSA reuse the same six fields as every other mode. Side a is always opposite angle A. AAS pairs it with the two known angles; SSA pairs it with side b and the angle opposite side a — not the angle between the two sides, which is SAS instead.
  • SSA can have zero, one, or two solutions. This calculator returns a plain-language error naming the reason for zero, the single triangle for one, and both triangles, clearly labelled, for two — it never silently picks one of two valid answers.
  • Sides between 0.1 and 10,000, angles up to 179°. The answer is held to those same bounds, so an ASA pair whose angles are nearly a straight line is rejected rather than returned at a precision the rest of the page does not have.
  • Rounding comes before naming. Angles are rounded to a hundredth of a degree (or four decimal places in radians) and lengths to four decimals, and the shape is classified from those rounded figures — so a triangle shown with a 90.00° angle is never labelled acute, in either unit.
  • Inradius and circumradius use the exact sides, not the rounded ones. Both radii are computed from the triangle’s unrounded area and side lengths, then rounded once for display — the same way the area itself is computed — so an extremely thin triangle whose printed area rounds to a very small figure can never turn a radius into a division by zero.
Common questions

Triangle FAQ

What is the triangle inequality?

Any two sides of a triangle, laid end to end, have to be longer than the third. Try it with sides of 3, 4 and 9: lay the 3 and the 4 flat along the 9 and they cover 7 of it, leaving a two-unit gap that nothing can close — and bending them upward at the joint only shortens the span they cover, never lengthens it. So no triangle has those sides. The equality case is the flat one: 3, 4 and 7 lie in a straight line and enclose no area at all, which is why this calculator rejects it too rather than reporting a triangle of area zero.

I know two sides and an angle — why does this sometimes show two answers?

Because two sides and an angle that is not between them — SSA — do not always describe just one triangle. Take sides of 5 and 7 with a 40° angle opposite the 5. Swing the side of length 5 down from the far end of the 7 and it can cross the third line in two different places, giving two genuinely different triangles: one with angles 40°, 64.15° and 75.85° and a third side of 7.5428, and one with angles 40°, 115.85° and 24.15° and a third side of 3.1819. Their areas are 16.97 and 7.16 — not close. Rather than pick one and hide the other, this calculator solves both and shows them side by side whenever the numbers allow it; when they don't — the side is too short to ever reach, or too long to leave room for a third angle — it says so instead of guessing.

How do I find the angles when all I know is the three sides?

The law of cosines, rearranged to give the angle instead of the side: cos A = (b² + c² − a²) ÷ 2bc, then take the inverse cosine. For 3, 4 and 5 that is (16 + 25 − 9) ÷ 40 = 0.8, and the angle whose cosine is 0.8 is 36.87°. Do it once more for B, then subtract both from 180° to get C. Computing the third angle the same way rather than subtracting is what makes some solvers print three angles that add to 179.99°.

Which area formula should I use when I do not know the height?

Heron's formula if you know all three sides — take the semi-perimeter s = (a + b + c) ÷ 2 and the area is √(s(s−a)(s−b)(s−c)). Half base times height needs a height, and the height of a triangle is rarely one of the numbers you actually have. If instead you know two sides and the angle between them, ½ab·sin C is quicker and exact. This page uses Heron in SSS mode and ½ab·sin C in every other mode, including both triangles of an ambiguous SSA reading.

What is the inradius and circumradius of a triangle?

The inradius is the radius of the largest circle that fits inside the triangle, touching all three sides — r = Area ÷ s, where s is the semi-perimeter, half the perimeter. The circumradius is the radius of the circle that passes through all three vertices — R = (a × b × c) ÷ (4 × Area). For the 3-4-5, s = 6 and Area = 6, so r = 1; and R = (3 × 4 × 5) ÷ (4 × 6) = 2.5. A right triangle has two shortcuts worth knowing: its circumradius is always exactly half its hypotenuse (Thales' theorem — the hypotenuse is a diameter of the circumcircle), and its inradius is always (leg + leg − hypotenuse) ÷ 2, which gives the same 1 for the 3-4-5 a faster way.

What is the difference between ASA and AAS?

Both give you two angles and one side, and both fix exactly one triangle — the difference is only which side. ASA's side sits between the two angles you know: enter angle A, angle B, then the side that joins them. AAS's side is opposite one of the angles instead: enter angle A, angle B, then the side opposite angle A. Mathematically they end up using the same tool, the law of sines, because knowing two angles hands you the third for free, and any one side together with its opposite angle is enough to scale the rest.

Can I enter angles in radians instead of degrees?

Yes — the advanced options include a degrees/radians toggle. Flipping it converts whatever is already typed, so the triangle itself does not change, only the unit its angles are measured in. Every angle this calculator returns, including both solutions to an ambiguous SSA reading, follows the same toggle. Side lengths, area, perimeter, inradius and circumradius are never affected, since none of them carry a unit of their own.

Is a 3-4-5 triangle always a right triangle?

Yes, and so is any triangle whose sides are in that ratio — 6-8-10, 30-40-50, 1.5-2-2.5. It works because 3² + 4² = 9 + 16 = 25 = 5², which is the converse of Pythagoras: if the squares on two sides add to the square on the third, the angle between those two sides is a right angle. That is the reason a 3-4-5 measurement squares a corner on a building site with nothing but a tape measure.

Can a triangle have two right angles?

No. The three angles of a plane triangle add to exactly 180°, so two right angles would use all of it and leave nothing for the third corner — the two sides would be parallel and would never meet. The same arithmetic rules out two obtuse angles. Every triangle has at least two acute angles, and the largest angle is the one opposite the longest side, which is how this calculator decides whether to call a triangle acute, right, or obtuse.

Primary sources

Sources and review notes

  1. Euclid, Elements, Book I (David E. Joyce’s edition, Clark University) — Proposition 20 for the triangle inequality, and Propositions 4, 8 and 26 for the SAS, SSS and ASA congruence criteria — three of the ways this page reads a triangle in. AAS follows from ASA once the third angle is known, and SSA is the ambiguous exception explained above
  2. W. Kahan, “Miscalculating Area and Angles of a Needle-like Triangle” — the stable rearrangement of Heron’s formula used here, and the worked demonstration of how much precision the textbook form throws away
  3. OpenStax, Precalculus 2e, §8.1 “Non-right Triangles: Law of Sines” — the ambiguous-case analysis this page’s SSA mode follows, including when two sides and a non-included angle produce one triangle, two, or none
  4. Eric W. Weisstein, “Incircle,” MathWorld — the inradius formula, r = Area ÷ s
  5. Eric W. Weisstein, “Circumradius,” MathWorld — the circumradius formula, R = abc ÷ (4 × Area)

Nothing on this page depends on data that can go stale. The relationships are the same ones Euclid set down; the sources are cited for the proofs, the ambiguous-case analysis, and the incircle and circumcircle identities — not for the arithmetic.