Triangle Calculator - SSS, SAS, ASA, AAS, SSA and Area
Solve a plane triangle from three sides or mixed sides and degree angles. SSA shows both solutions when the ambiguous case allows two. Runs in your browser.
Given Parts
Sides a, b, c sit opposite angles A, B, C. Angles are in degrees, not radians. The 3-4-5 default is a right triangle with area 6.
Solved Triangle
What Is a Triangle Calculator and Why Do You Need One?
A triangle calculator finishes a plane triangle from a legal set of given parts: three sides (SSS), two sides and the included angle (SAS), two angles and the included side (ASA), two angles and a non-included side (AAS), or two sides and a non-included angle (SSA). Standard labeling puts side a opposite angle A, side b opposite B, and side c opposite C. This page uses degrees for every angle, not radians.
Surveyors, CAD drafts, roof pitches, and high-school geometry sets all reduce to the same two identities: the law of sines and the law of cosines. Doing them by hand is fine until SSA produces two plausible triangles, or until a rounding error in arccos makes three angles that no longer add to 180°. The solver here recomputes the third angle as 180° minus the other two whenever that is the honest remainder, and it refuses non-positive sides, angles outside (0°, 180°), and angle sums that are already 180° or more.
This free online triangle solver runs entirely in your browser. Nothing is uploaded. Pair the result with the slope calculator when a side is a line segment between two points, with the volume calculator when a triangular prism or pyramid needs a base area, or with the scientific calculator for a one-off sine or arccos check.
How to Use This Free Online Triangle Calculator
Using this SSS SAS ASA AAS SSA tool is straightforward:
- Choose the given parts. SSS is three sides. SAS is sides a and b with included angle C. ASA is angles A and B with included side c (the side between those angles). AAS is angles A and B plus side a opposite A. SSA is angle A, opposite side a, and another side b.
- Type the known numbers. Sides must be positive. Angles must lie strictly between 0° and 180°. Commas in a number are stripped.
- Read all three sides, all three angles, both area formulas, and the perimeter. If SSA admits two triangles, both are listed instead of silently picking one.
- Copy the solution, or clear the fields. The last mode and numbers are saved in this browser for up to 30 days.
Note: this is Euclidean plane geometry. It does not solve spherical triangles, 3-D tetrahedron faces as a mesh, or triangles with a reflex interior angle. JavaScript IEEE-754 rounding can leave the last digit noisy on very skinny triangles.
How to Solve a Triangle - SSS, SAS, ASA, AAS, and SSA
Congruence shorthand is the whole job: you are not “drawing a pretty picture,” you are asking whether the given measurements determine a unique triangle, two triangles, or none. SSS and SAS and ASA (and AAS, which is ASA after you fill the third angle) each determine at most one triangle when the numbers are legal. SSA is the outlier.
SSS starts with the triangle inequality: a+b>c and cyclic. Then the law of cosines gives each angle:
SAS (here: a, included C, b) finds the third side first:
ASA and AAS compute the missing angle as 180° − A − B, then scale sides with the law of sines a / sin A = b / sin B = c / sin C. AAS is not SAS: the given side is opposite one of the angles, not sandwiched between them.
SSS vs SAS - Which Given Parts Do You Have?
| Code | You already know | Main identity | Unique? |
|---|---|---|---|
| SSS | a, b, c | Law of cosines | Yes, if inequality holds |
| SAS | a, C, b (C included) | Law of cosines for c | Yes, if C ∈ (0°, 180°) |
| ASA | A, c, B (c included) | Law of sines | Yes, if A+B < 180° |
| AAS | A, B, a (a not included) | Law of sines | Yes, if A+B < 180° |
| SSA | A, a, b | Law of sines for B | Zero, one, or two |
The practical mix-up is calling SSA “SAS” because you have two sides and an angle. SAS requires that angle to sit between the two sides. If the angle is opposite one of them, you are in SSA and you must run the height test, not the included-angle cosine formula.
SSA Ambiguous Case - When Two Triangles Fit
Given acute angle A, opposite side a, and adjacent side b, the altitude from the unknown vertex to side b is h = b sin A. Geometry then splits:
- a < h: the opposite side cannot reach the base. No triangle.
- a = h: one right triangle (angle B = 90°).
- h < a < b: two triangles. Angle B can be arcsin(b sin A / a) or its supplement 180° minus that value. Both leave a positive C = 180° − A − B.
- a ≥ b: at most one triangle, because the obtuse candidate for B would make A+B ≥ 180°.
If A is obtuse, you need a > b or there is no triangle at all - the longer side must sit opposite the larger angle. This calculator does not hide the second SSA solution. If two triangles exist, both sides, angles, areas, and perimeters are shown. If none exist, you get an error rather than a NaN angle.
Worked numbers: A = 40°, a = 7, b = 10. Then h = 10 sin 40° ≈ 6.428. Because 6.428 < 7 < 10, two triangles appear. One has B ≈ 66.674° and C ≈ 73.326°. The other has B ≈ 113.326° and C ≈ 26.674°. Both satisfy the law of sines with the same a, b, and A. That is the ambiguous case, not a bug.
How to Find the Area of a Triangle - Heron and ½ab sin C
After the missing parts are filled, two area formulas become available. ½ab sin C uses sides a and b with the included angle C. Heron’s formula uses only the three sides: let s = (a+b+c)/2, then area = √[s(s−a)(s−b)(s−c)]. For a non-degenerate triangle they agree up to floating-point noise. The 3-4-5 default gives area 6 both ways: ½·3·4·sin 90° = 6, and √[6(3)(2)(1)] = 6.
Base-times-height / 2 is the same identity in disguise: the height to side b is a sin C when C is included between a and b. If you only have three sides, Heron (or first finding an angle with the law of cosines) is the route. This page always prints both once a full triangle exists, so a homework key that wanted Heron still has a number to quote, and a key that wanted ½ab sin C does too.
Perimeter is the unglamorous sum a+b+c. It is listed because fencing, trim, and wire problems ask for it more often than textbooks admit.
Law of Sines vs Law of Cosines
The law of sines is a / sin A = b / sin B = c / sin C = 2R, where R is the circumradius. It needs a known angle–opposite-side pair. ASA, AAS, and SSA all start there. The inverse sine has a supplementary twin, which is exactly why SSA can fork.
The law of cosines is a² = b² + c² − 2bc cos A (and cyclic). It does not have an ambiguous inverse in the same way: arccos on a clamped cosine in [−1, 1] returns a unique angle in (0°, 180°) for a plane triangle. SSS and SAS therefore use cosine first. Pythagoras is the special case cos C = 0, which is why 3-4-5 is a right triangle and C comes out 90°.
Do not use the law of sines alone to finish SSS. You would have to invent an angle. Do not use the law of cosines on SSA as if the angle were included - that is the SAS formula on the wrong data, and it will invent a third side that does not match the geometry you were given.
Worked Example - SSS 3, 4, 5 Right Triangle
Load SSS with a = 3, b = 4, c = 5 (the page default). Cosine of C is (9+16−25)/(2·3·4) = 0, so C = 90°. Angle A is arccos((16+25−9)/(2·4·5)) = arccos(0.8) ≈ 36.8698976458°. Angle B is 180° − 90° − A ≈ 53.1301023542°. Area is 6. Perimeter is 12. If you switch to SAS with a = 3, C = 90°, b = 4, the third side reconstructs as 5. If you switch to SSA with A ≈ 36.87°, a = 3, b = 4, only one triangle appears because a is not strictly between the altitude and b in the two-solution window in the same way - here a < b but the configuration is the unique acute/right 3-4-5.
Another SAS check: a = 7, C = 60°, b = 7. Then c² = 49+49 − 2·7·7·½ = 49, c = 7, an equilateral triangle, all angles 60°, area (√3/4)·49. If ASA is fed A = 50°, c = 10, B = 60°, then C = 70° and the sides follow from 10 / sin 70°. If someone types A = 100° and B = 90° in ASA, A+B ≥ 180° and the calculator errors instead of emitting a negative third angle.
Degrees vs Radians in a Triangle Calculator
Every angle field on this page is in degrees. JavaScript’s Math.sin, Math.cos, and Math.acos speak radians, so the solver converts with π/180 internally and converts back before it prints A, B, and C. If you paste 1.5708 thinking that is a right angle, the tool treats it as about one and a half degrees. School problems that say “π/3 rad” must be rewritten as 60° first.
Inverse cosine returns a unique angle in (0°, 180°) after we clamp the cosine into [−1, 1] to absorb rounding. Inverse sine returns an acute (or right) angle; the SSA branch then considers the supplement 180° − B as a second candidate. Mixing those two inverse functions is how people accidentally “lose” the obtuse triangle in SSA. The calculator keeps both candidates and drops only those whose remaining angle would not be positive.
Where Triangle Solving Shows Up in Real Work
Surveying and construction still reduce to SAS and SSS: two measured walls and the included corner, or three paced sides of a lot. A roof rafter is a right triangle whose run and rise you might first get from the slope calculator as a line through two points, then feed the three lengths back here as SSS. Navigation problems that stay on a flat map (not a globe) are ASA or AAS: two bearings and a baseline. Spherical excess on Earth is a different formula; this page will not add 180° plus excess.
Computer graphics often needs the area of a triangle for barycentric coordinates; Heron or ½ab sin C both work once the vertices are converted to side lengths. A triangular prism’s volume is that base area times length - use this solver for the face, then the volume calculator is the wrong shape menu for an arbitrary triangle prism, so multiply by length yourself. For a one-off sine you can also open the scientific calculator; it will not enforce triangle inequality or SSA branching.
Physics free-body diagrams resolve a force into components with a right triangle. SSS 3-4-5 is the sanity check that the hypotenuse came out 5.
Common Triangle Calculator Mistakes
Labeling is the first trap. Side a must sit opposite angle A. If your sketch put the 7 next to angle A, you do not have SSA with a = 7; you have an adjacent side and the mode is wrong. SAS vs SSA is the second trap: included vs opposite. The third is feeding radians. The fourth is accepting a second SSA triangle when C would be negative - the extra inverse-sine root is not always legal. This tool drops it.
Rounding three angles independently with the law of cosines can make A+B+C print as 180.002°. Here the third angle is forced as 180° minus the other two after two cosines (SSS) or after the given pair (ASA/AAS). Tiny leftover error then sits in the sides, which is the honest IEEE remainder, not a claim that angles stopped adding to 180°.
People also type a side of 0 “to see what happens.” A degenerate stick is not a triangle; the calculator errors. Likewise 180° as an interior angle is a straight line, not a vertex of a simple triangle. Obtuse angles are allowed as long as they stay strictly under 180° and the other two still fit.
Honest Limits of This Triangle Solver
- Degrees only. There is no radian mode. π/2 typed as 1.5708 is a tiny angle, not a right angle.
- Plane geometry. Spherical excess, GPS ellipsoids, and great-circle triangles are out of scope.
- SSA near the altitude. When a is extremely close to b sin A, floating-point can tip “one right triangle” versus “none.” The height test uses a 10⁻¹⁰ tolerance, not a symbolic CAS.
- No unit conversion. Mixing feet and meters in the three sides is your problem; the inequality will still run on the raw numbers.
- Not a drawing tool. It does not export SVG or label a scaled sketch. Copy the numbers into CAD or homework.
Frequently Asked Questions (FAQ) - Triangle Calculator
How do you solve a triangle?
Identify which parts you already have (SSS, SAS, ASA, AAS, or SSA). Use the law of cosines when you have two sides and the included angle, or all three sides. Use the law of sines when you have an angle and its opposite side plus one more part. The third angle is 180° minus the other two. This calculator does those steps in degrees.
What is the difference between SSS and SAS?
SSS is three sides. SAS is two sides and the angle between those two sides (the included angle). SSS uses the triangle inequality and the law of cosines for every angle. SAS uses the law of cosines to get the third side first, then the remaining angles. SAS is not the same as SSA, where the angle is not between the two given sides.
What is the SSA ambiguous case?
SSA gives an angle, the side opposite that angle, and another side. Depending on the height h = b sin A, you can get no triangle, one triangle, or two triangles. If two solutions exist, this tool shows both. If the height test fails, you get an error instead of a fake extra triangle.
How do you find the area of a triangle?
When all three sides are known, Heron’s formula uses the semi-perimeter s = (a+b+c)/2 and area = √[s(s−a)(s−b)(s−c)]. When two sides and the included angle are known, area = ½ab sin C. After this solver fills in the missing parts it reports both formulas so you can cross-check.
When should I use the law of sines vs the law of cosines?
Law of cosines: a² = b² + c² − 2bc cos A, and cyclic, when you know SSS or SAS. Law of sines: a/sin A = b/sin B = c/sin C when you know an angle–opposite-side pair (ASA, AAS, SSA). Do not use the law of sines alone to finish SSS; the included-angle information is missing and you would be guessing an angle.
Does this triangle calculator upload my numbers?
No. Solving runs in your browser with JavaScript. Nothing is sent to a server. After the page loads, the tool still works if the network drops. The last inputs are stored only in localStorage on this device for up to 30 days.
Why Choose Our Triangle Calculator?
- Free, no account. Unlimited SSS/SAS/ASA/AAS/SSA solves.
- Private. All trigonometry stays in the browser.
- SSA shows both triangles when the ambiguous case allows two, and errors when none exist.
- Both area formulas - ½ab sin C and Heron - plus perimeter.
- Degrees, labeled sides a,b,c opposite A,B,C so the homework diagram matches.
- Honest limits on plane geometry and floating-point, not a fake “infinite precision” claim.
- Works offline after the first page load.
Related Tools
Discover more free developer tools that might interest you.
Area Calculator
Calculate area of squares, rectangles, triangles, circles, and more
Use ToolAverage Calculator
Calculate mean, median, mode, and range from a list of numbers
Use ToolBasic Calculator
Add, subtract, multiply, and divide with a free online calculator
Use ToolBig Number Calculator
Add, subtract, multiply, and divide integers too large for a standard calculator
Use ToolBinary Calculator
Add, subtract, and convert binary numbers to decimal and hex
Use ToolCircle Calculator
Find radius, diameter, circumference, area, arc length, and sector area
Use Tool