Triangle Calculator
Six boxes sit under the stage: the sides a, b and c, and the angles A, B and C opposite them. Fill any three and the tool reads which case you gave it, three sides, two sides and the angle between them, two angles and a side, or two sides and an angle outside them, then solves that case and says which law it used. The side-side-angle case is the reason this page is worth a visit: for a whole range of inputs two different triangles fit the same three numbers, and both are solved and drawn rather than one being quietly picked for you. Every angle is exact where the arithmetic is exact, so a 3, 4, 5 triangle reports a right angle of 90 degrees and an area of exactly 6, and three lengths that cannot close are refused with the reason instead of an answer. Angles read in degrees or radians, the figure redraws to scale as you type, and nothing is uploaded.
a 7 b 8 c 9 A 48.1897° B 58.4119° C 73.3985° area 26.8328 perimeter 24 law of cosines for each angle, Heron's formula for the area
Three sides: a, b and c. Each angle comes from the law of cosines, and the area from Heron's formula. Any two sides have to add to more than the third or the triangle never closes.
SSS, three sides. One triangle fits.
Common questions
- Which three values do I need to solve a triangle?
- Any three except three angles. Three sides (SSS) go to the law of cosines. Two sides with the angle between them (SAS) get the third side from the law of cosines first. Two angles with the side between them (ASA), or two angles and a side beside them (AAS), take the third angle from the 180 degree sum and the two missing sides from the law of sines. Two sides with an angle that is not between them (SSA) are the ambiguous case below. Three angles are refused, and the tool says why: they set the shape of the triangle but not its size, so every triangle with those angles would be a correct answer. Fill a fourth box and it asks you to clear one rather than quietly ignoring it, because four values can disagree with each other.
- Why does side-side-angle sometimes give two triangles?
- Because two triangles really do fit. Take a = 8, b = 10 and A = 30 degrees. The height from the far corner down to the base is b times the sine of A, which is 5, and side a at 8 is longer than that height but shorter than b, so it can swing down to meet the base in two different places. One triangle has B at 38.6822 degrees, the other has B at 141.3178 degrees, the supplement of the first, and both satisfy the law of sines. This tool solves both, draws both and labels them first and second. If a is shorter than the height no triangle closes at all, and if a is at least as long as b only one does; the tool says which of those three you are in.
- Can it solve a right triangle as well?
- Yes, a right angle is simply one of the answers rather than an assumption. Type 3, 4 and 5 as the three sides and angle C comes back as 90 degrees exactly, not 89.99999, with an area of exactly 6 and a square drawn in the right-angled corner. That exactness is deliberate: the cosine ratios are clamped into the range they belong in, the common angles are held as exact values, and an angle that agrees with a whole number to thirteen significant digits is settled onto it. If you know only two values of a right triangle, the right triangle calculator is the page for that, since it can assume the 90 degree corner and this one cannot.
- What happens when three numbers do not make a triangle?
- You get a sentence naming the problem, not a result. Sides 1, 2 and 4 are refused because 1 and 2 together are shorter than 4, so the short sides never reach across the long one. Sides 1, 2 and 3 are refused differently: they add up exactly, so the corners fall on one straight line and there is no height. Two angles that already total 180 degrees leave nothing for the third. An angle of 180 degrees or more, a side of zero and a negative length each get their own message. Lengths so large or so small that the area overflows or underflows double precision are refused too, with a message saying to scale all three by the same number, which leaves the angles unchanged.
- Can I work in radians instead of degrees?
- Yes, and switching does not change your triangle. The Angles in control flips between degrees and radians, and the numbers already in the angle boxes are rewritten as it goes, so 90 becomes 1.57079632679. Switch back and the box reads 90 again, not 89.9999999997: each box keeps the text it held in the other unit and gets that text back untouched, unless you changed the number in between, in which case it is converted like any other. Angles then come back in the unit you chose, a right angle reading 1.5708 radians, and the three angles of a triangle add to pi radians instead of 180 degrees. The label on every angle box changes with the unit, so a box asking for radians is never read as degrees.
- Is anything uploaded, and are my numbers kept?
- Nothing is uploaded. The trigonometry runs in your browser and the page makes no request while you type, so your measurements are not sent anywhere or counted by anything. The six boxes and the angle unit are remembered in this browser alone so the page opens where you left it, and clearing your site data or pressing Start over forgets them. The figures on the stage are rounded for reading, six significant figures for a length, an area or an angle in radians, and four decimal places for an angle in degrees, and the Copy button hands you those same figures; the arithmetic behind them is full double precision.
Exact trigonometry by the law of cosines and the law of sines, with rounding clamped so a right angle does not come back as 89.999 degrees. The ambiguous side-side-angle case returns both valid triangles rather than picking one.