Triangle Calculator
A triangle with sides of 8, 11 and an included angle of 62 degrees has a third side of 10.12 and an area of 38.85. The three angles work out to 44.28, 73.72 and 62 degrees, which always sum to 180.
Pick what you know, enter the three measurements, and the calculator solves the whole triangle.
| Side a | |
| Side b | |
| Side c | |
| Angle A | |
| Angle B | |
| Angle C | |
| Area | |
| Perimeter | |
| Classification | |
| Formula used |
All calculations run in your browser, and nothing you type is uploaded or stored.
Type in any three independent measurements of a triangle and this calculator returns the three sides, the three angles, the area and the perimeter.
Key takeaways
- Three sides (SSS), two sides plus the included angle (SAS) and two angles plus one side (AAS or ASA) are the three inputs that pin down a triangle
- Law of cosines: c^2 = a^2 + b^2 - 2ab x cos(C) handles SSS and SAS, and collapses to the Pythagorean theorem when C is 90 degrees
- Law of sines: a / sin(A) = b / sin(B) = c / sin(C) handles AAS and ASA, since two angles hand you the third
- Two sides and a non included angle (SSA) can produce zero, one or two triangles, which is why this calculator asks for a third input
- Heron's formula turns three sides into area: s(s-a)(s-b)(s-c) with s = half the perimeter
On this page
- The six numbers that describe any triangle
- Which three inputs solve a triangle
- The two laws that do the work
- Worked example: a garden plot with three known sides
- Worked example: two fences and the angle between them
- Worked example: one side and two angles
- How this page differs from our right triangle pages
- Inputs that fail, and why
The six numbers that describe any triangle
Every triangle, right angled or not, has three sides and three angles, and the six numbers depend on each other. Fix three of them, chosen the right way, and the other three follow. This calculator takes those three inputs and returns the complete set.
Not every combination of three numbers works. Three angles alone set the shape but not the size, so a triangle can be drawn at any scale and all three inputs are wasted. Two sides with an angle that is not sandwiched between them can describe two different triangles at once, or none. The working combinations have names that textbooks have used for a century, and the table below shows all of them.
NASA's Glenn Research Center covers the same ground for flight and engineering problems, where a heading change plus two distances is a triangle that needs solving before the aircraft can be turned toward a waypoint. The math is identical to the surveying and workshop cases below.
Which three inputs solve a triangle
The calculator accepts three cases. Each one runs a different formula, chosen automatically from what you type.
| Case | You enter | What runs | Also returned |
|---|---|---|---|
| SSS | Sides a, b, c | Law of cosines twice, then the 180 degree sum | Area by Heron's formula |
| SAS | Sides a, b and angle C between them | Law of cosines for the third side | Remaining angles, area by the sine formula |
| AAS or ASA | Two angles and one side | Law of sines after the third angle falls out of 180 | All three sides, area and perimeter |
Two cases are refused. AAA gives shape with no scale, and SSA can be ambiguous: sides of 10 and 7 with a 45 degree angle opposite the 10 fits a single triangle, but sides of 7 and 10 with the 45 degree angle opposite the 7 fit two triangles, one with a 29.67 degree angle and one with a 150.33 degree angle at the far end. A calculator that silently picks one of them is guessing, so this one asks for a third measurement instead.
The two laws that do the work
Two formulas cover every solvable triangle. The law of cosines says that the square of any side equals the squares of the other two sides, minus twice their product times the cosine of the angle wedged between them:
c^2 = a^2 + b^2 - 2ab x cos(C)
When C is 90 degrees, the cosine term is zero and the law collapses to the Pythagorean theorem. That makes the Pythagorean calculation one special case of this one, and it is why the same calculator can check a square corner. The HyperPhysics reference at Georgia State University walks through the derivation and the pairing with the second law.
The law of sines says that each side divided by the sine of its opposite angle gives the same number for all three pairs:
a / sin(A) = b / sin(B) = c / sin(C)
The two laws split the work by input. The law of cosines is the tool when you know sides and need angles, or know two sides plus the angle between them and need the third side. The law of sines takes over when you know an angle and its opposite side together, which happens in the AAS and ASA cases. OpenStax Algebra and Trigonometry, section 10.2 works both cases with full examples.
Worked example: a garden plot with three known sides
A triangular garden bed measures 7, 9 and 12 feet along its three sides. Three sides is the SSS case, so the law of cosines runs twice and the third angle comes from the 180 degree sum.
For the angle opposite the 12 foot side: cos(C) = (49 + 81 - 144) / (2 x 7 x 9) = -14 / 126 = -0.1111, which gives C = 96.38 degrees. The negative cosine is the tell for an obtuse corner. The angle opposite the 9 foot side comes out to 48.19 degrees and the one opposite the 7 foot side to 35.43 degrees, and the three sum to 180.
For the area, Heron's formula needs the half perimeter: s = (7 + 9 + 12) / 2 = 14. The area is the square root of 14 x 7 x 5 x 2 = 980, which is 31.30 square feet. At the typical spacing of one plant per square foot that bed holds about 31 plants, a number that comes straight out of the geometry and not from a guess.
| Part | Computation | Answer |
|---|---|---|
| Side opposite 7 ft | cos(A) = (b^2 + c^2 - a^2) / (2bc) = (81 + 144 - 49) / 216 | 0.8148, so A = 35.43 degrees |
| Side opposite 9 ft | cos(B) = (a^2 + c^2 - b^2) / (2ac) = (49 + 144 - 81) / 168 | 0.6667, so B = 48.19 degrees |
| Side opposite 12 ft | 180 - 35.43 - 48.19 | C = 96.38 degrees, obtuse |
| Area | sqrt(14 x 7 x 5 x 2) = sqrt(980) | 31.30 square feet |
Worked example: two fences and the angle between them
SAS is the case where you can reach the two sides but cannot reach across. Two fence runs leave the same gate at an angle of 125 degrees between them, one 38 meters long and the other 53 meters. The distance across the open ends is the side opposite the 125 degree angle.
c^2 = 38^2 + 53^2 - 2 x 38 x 53 x cos(125 degrees) = 1,444 + 2,809 + 2,310.37 = 6,563.37, so c = 81.01 meters.
Note that the cosine of 125 degrees is negative, so the subtracted term turns into an addition and the cross distance is longer than either fence. That sign flip is why SAS answers go wrong when someone drops the minus sign from the formula. The enclosed area is 0.5 x 38 x 53 x sin(125 degrees) = 824.9 square meters, and the calculator returns that without any extra input.
Worked example: one side and two angles
The AAS case starts small. Suppose one shore-to-shore distance has been measured at 20 kilometers, and the angles at each end read 55 and 40 degrees from the baseline to an island. The third angle is 180 - 55 - 40 = 85 degrees before any side work begins.
The law of sines then gives the two remaining sides. The side opposite the 55 degree angle is 20 x sin(55) / sin(85) = 16.45 kilometers, and the side opposite the 40 degree angle is 20 x sin(40) / sin(85) = 12.90 kilometers. The perimeter of the crossing triangle is 20 + 16.45 + 12.90 = 49.35 kilometers.
This is the classic triangulation setup that surveying grew out of: measure one distance with care, then let angles carry the rest. The error in the single measured side propagates into everything else, so that one baseline is the number worth double checking.
How this page differs from our right triangle pages
We publish a Pythagorean theorem calculator and a right triangle calculator, and both are limited to triangles with a 90 degree corner, because the theorem only holds there. This page drops that requirement: any three independent measurements of any triangle work, and the answers come from the law of cosines and the law of sines rather than from a^2 + b^2 = c^2.
Feed this calculator a 3-4-5 right triangle through the SSS input and it returns the same answers the dedicated right triangle page gives, with the third angle landing on 90 and the other two on 36.87 and 53.13 degrees. The right angled pages remain the better choice when you know the corner is square and want the 3D box diagonal, the altitude to the hypotenuse or the inradius, which this general page does not compute. For every other triangle, the general case here is the one that produces an answer at all.
Inputs that fail, and why
A triangle calculator is honest about bad input only if it checks the geometry, so this one enforces the rules a draftsman would.
Triangle inequality. The two short sides must add to more than the long side. Sides of 3, 4 and 8 fail because 3 + 4 = 7 is less than 8, and no triangle closes. The calculator reports the failure instead of returning an area from Heron's formula for a negative number under the root.
Angle sum. Two entered angles must add to less than 180 degrees, since the third corner needs a positive share. Angles of 100 and 95 leave the third corner at -15 degrees, which is not a triangle.
Units. The three inputs must share one unit. A 7 foot side entered next to a 9 meter side produces numbers that check out numerically and mean nothing physically, the same trap that the ramp example on the right triangle page runs into with inches and feet. The calculator takes one unit for all three sides and keeps angles in degrees.
Rounding. Entering angles already rounded to whole degrees can move a computed side by a noticeable margin on short triangles. When the source data came from a protractor, treat the fourth significant digit of the answer as noise.
| Input | Rule it breaks | What the calculator says |
|---|---|---|
| Sides 3, 4, 8 | Triangle inequality, since 3 + 4 = 7 is less than 8 | No triangle closes |
| Angles 100 and 95 degrees | Angle sum, since the third corner would be -15 degrees | Refused |
| Sides 7 and 9 with no third value | Only two independent measurements | Waiting for a third input |
Frequently asked questions
How do I solve a triangle with three sides known?
That is the SSS case. Apply the law of cosines twice: cos(C) = (a^2 + b^2 - c^2) / (2ab) gives one angle, a second application gives another, and the third is 180 minus both. Sides of 7, 9 and 12 give angles of 35.43, 48.19 and 96.38 degrees. Heron's formula then gives the area, 31.30 square units for those sides.
How do I find the third side from two sides and the included angle?
Use the law of cosines: c^2 = a^2 + b^2 - 2ab x cos(C). Sides of 8 and 11 with a 62 degree angle between them give c^2 = 102.37, so the third side is 10.12.
What is the law of sines used for?
It is used when you know an angle together with its opposite side, which happens in the AAS and ASA cases. Each side divided by the sine of its opposite angle is the same constant: a / sin(A) = b / sin(B) = c / sin(C).
How do I find an angle from three sides?
Rearrange the law of cosines: cos(C) = (a^2 + b^2 - c^2) / (2ab). Take the inverse cosine of the right hand side. A negative result means the angle is obtuse, so sides of 7, 9 and 12 give cos(C) = -0.1111 and C = 96.38 degrees.
Can this calculator handle right triangles too?
Yes. A right triangle is just a triangle, so entering its sides through the SSS input returns the same 90 degree corner and the same angles. Our dedicated right triangle calculator is the better tool when you want the altitude to the hypotenuse or the inradius.
What does SSA mean and why is it ambiguous?
SSA is two sides plus an angle that is not between them. Depending on the numbers it can produce two different triangles, exactly one, or none. Sides of 10 and 7 with a 45 degree angle opposite the 10 give one triangle, but swap which side faces the angle and two different triangles both fit, so the calculator asks for a third input.
How do I calculate the area of an oblique triangle?
With Heron's formula if you know all three sides: s = (a + b + c) / 2, then area = sqrt(s(s-a)(s-b)(s-c)). With two sides and the included angle, area = 0.5 x a x b x sin(C). A 38 by 53 meter enclosure with a 125 degree angle has an area of 824.9 square meters.
Why do the three angles always add to 180 degrees?
That is the angle sum property of Euclidean triangles, and it holds only on a flat plane. On a sphere, such as the surface of the Earth over long distances, the angles of a triangle add to more than 180 degrees, which is why great circle navigation does not use these formulas directly.
What is the triangle inequality?
Each side must be shorter than the sum of the other two. Sides of 3, 4 and 8 violate it because 3 + 4 = 7 is less than 8. If the inequality fails, no triangle exists, and the calculator should refuse the input rather than return a nonsensical area.
Do I need radians or degrees?
Degrees for angles, and this page works in degrees throughout. Radians appear inside the math of any computing device, but a handheld protractor or a compass rose reads degrees, so degree input is what the calculator takes.
How is this different from the Pythagorean theorem?
The Pythagorean theorem, a^2 + b^2 = c^2, only works when one angle is exactly 90 degrees. The law of cosines is its general form: when C is 90 degrees, cos(C) is 0 and the formula collapses to the Pythagorean case.
Can I use this for land surveying?
Yes, triangulation is exactly this math. Measure one baseline distance with care, measure the angles from each end to a landmark, and the law of sines produces the remaining distances. A 20 kilometer baseline with end angles of 55 and 40 degrees puts the landmark 16.45 and 12.90 kilometers from the two ends.
What is Heron's formula?
Heron's formula computes the area of a triangle from the three sides alone. First compute the half perimeter s = (a + b + c) / 2, then take the square root of s(s-a)(s-b)(s-c). Sides of 7, 9 and 12 give s = 14 and an area of 31.30 square units.
How precise are the answers?
The calculator works to double precision and rounds for display, so the precision you see is limited by the precision of your inputs. Angles entered to the nearest degree typically move computed sides by a fraction of a percent, which on a 10 meter side is several centimeters.
Why does my SAS answer come out longer than either side?
When the included angle is obtuse, its cosine is negative, and the minus 2ab x cos(C) term in the law of cosines becomes an addition. The third side then exceeds both known sides, as with the 38 and 53 meter fences meeting at 125 degrees, which gives a cross distance of 81.01 meters.
Can a triangle have two obtuse angles?
No. Since the three angles sum to 180 degrees, two angles above 90 would already pass 180 with nothing left for the third corner. At most one angle of a triangle is obtuse, and the side opposite it is the longest.
Spotted a wrong number or a broken result?
More Math tools
Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.