Skip to content
Calcapedia
Math

Triangle Solver Calculator

Know three sides or angles of a triangle (SSS, SAS, ASA, AAS or SSA)? Find all the rest with the laws of sines and cosines.

Level: Grades 10–11

  • Common Core standard HSG.SRT.D.11(+) Understand and apply the Law of Sines and the Law of Cosines to find unknown measurements in right and non-right triangles (e.g., surveying problems, resultant forces).
Printable worksheet

Triangle Solver Calculator

Know the answer you need? Pick an input to work backward.

Inputs

Result

Area

17.3205 square units

Sides 5, 7, 8 and angles 38.2132°, 60°, 81.7868°: an acute scalene triangle with area 17.3205.

Solutions
One triangle
Side a
5
Side b
7
Side c
8
Angle A
38.2132 °
Angle B
60 °
Angle C
81.7868 °
Perimeter
20
Type by angles
Acute
Type by sides
Scalene

See the step-by-step solution ↓

Step-by-step solution

  1. Use the law of cosines to find the cosine of angle A from sides b, c and a

    cos A=72+82−522×7×8=0.78571429
  2. Turn that cosine back into an angle (inverse cosine, the cos⁻¹ key) to get angle A

    A=arccos(0.78571429)=38.213211°
  3. Use the law of cosines to find the cosine of angle B from sides a, c and b

    cos B=52+82−722×5×8=0.5
  4. Turn that cosine back into an angle (inverse cosine, the cos⁻¹ key) to get angle B

    B=arccos(0.5)=60°
  5. A triangle's angles always add up to 180°, so angle C is 180° minus the other two

    C=180°−38.213211°−60°=81.786789°
  6. Find half the perimeter (s): add the three sides and divide by 2

    s=5+7+82=10
  7. Find the area with Heron's formula, which needs only the three sides, no height

    Area=10×(10−5)×(10−7)×(10−8)=300=17.320508
  8. Perimeter: add the three sides

    P=5+7+8=20

Test yourself

20 quick questions built from this calculator's formula: work out results, predict what happens when an input changes, and work backward from an answer. Every answer comes with the working.

What this calculator does

Find every missing side and angle of a triangle from the three you already know. A triangle has six measurements: three sides and three angles. Fix any three of them, as long as at least one is a side, and the other three are normally set. The calculator works out the rest with two classic rules, the law of sines and the law of cosines. Then it gives you the area, the perimeter and what kind of triangle it is.

One combination needs care. Sometimes you know two sides and an angle that isn't between them (SSA). Those measurements can fit two different triangles, exactly one, or none at all. The calculator checks which case applies. When two triangles are possible, it shows both side by side instead of quietly picking one.

Where it's used

Why this math matters outside the classroom:

  • Land surveying. A surveyor who measures sides of 80 m and 60 m with 50° between them finds the third side by the law of cosines, about 61.9 m.
  • Navigation. A ship that sails 10 km, turns 30° and sails another 8 km uses the law of cosines to find it is about 17.4 km from port.
  • Distance to a tower. Observers 500 m apart sight a tower at 60° and 70°, so the law of sines puts it 500 × sin 70° ÷ sin 50°, about 613 m, from the first.
  • Roof spans. Two 12 ft rafters meeting at 100° span 2 × 12 × sin 50°, about 18.4 ft, at their base.
  • Combining forces. Forces of 30 N and 40 N pulling 60° apart combine to √(30² + 40² + 2 × 30 × 40 × cos 60°), about 60.8 N.

Grade level and standards: Grades 10–11; Common Core State Standards for Mathematics HSG.SRT.D.11. © Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.

How to use it

  1. Choose what you know: three sides (SSS) or two sides and the angle between them (SAS). Or two angles and the side between them (ASA), or two angles and another side (AAS). The last choice is two sides and an angle that isn't between them (SSA).
  2. Enter the values. Side a is always across from angle A, side b across from angle B and side c across from angle C. So label your sketch the same way before you type.
  3. Enter angles in degrees. Sides can be in any unit, as long as they all use the same one.
  4. Read the area, sides, angles, perimeter and type. In the two-answer SSA case, a table compares the two possible triangles.

What the inputs mean

What you know
The letters list the parts you know, in order around the triangle. S stands for a side and A for an angle. In SAS, the angle sits between the two sides. In ASA, the side sits between the two angles.
Angle A (opposite side a)
In degrees, more than 0° and less than 180°. In ASA and AAS, angles A and B together must leave room for angle C. So they must add up to less than 180°.
Angle C (between sides a and b)
The angle where sides a and b meet. If the angle you know isn't between your two sides, use SSA instead.

Formula and method

Law of sines: a ÷ sin A = b ÷ sin B = c ÷ sin C
Law of cosines: c² = a² + b² − 2ab × cos C
Angle from three sides: cos A = (b² + c² − a²) ÷ (2bc)
Angle sum: A + B + C = 180°
Heron's formula: s = (a + b + c) ÷ 2;  area = √(s(s − a)(s − b)(s − c))

In the formulas, a, b and c are the sides, and A, B and C are the angles across from them. sin and cos (sine and cosine) are standard functions that link an angle to side lengths. Your calculator's sin and cos keys give them. s is the semi-perimeter, half the distance around the triangle.

The law of cosines handles the cases that start from sides. With three sides (SSS), it gives each angle directly. With two sides and the angle between them (SAS), it gives the third side first, and then the angles follow. When the angle is 90°, its cosine is zero, and the law becomes the Pythagorean theorem.

The law of sines handles the cases that start from angles. Once two angles are known, the third is 180° minus their sum. Then every side is a known side scaled by a ratio of sines.

In the SSA case, the law of sines gives sin B. An acute angle (under 90°) and its supplement (180° minus it) have the same sine. So both B and 180° − B may work. The second triangle exists only if side a is shorter than side b, but at least as long as the height b × sin A.

The area always comes from Heron's formula, which needs only the three sides. The calculator uses a rearranged form that stays accurate for long, thin triangles. A triangle counts as right when its largest angle is 90°, to within a billionth of a degree. It's obtuse when that angle is larger and acute when it's smaller.

Worked example

Two straight fences, 5 m and 7 m long, meet at a 60° corner. A third fence will close the triangle. How long must it be, and how much ground does it enclose?

  1. This is SAS: a = 5, b = 7, and the angle between them is C = 60°.
  2. Law of cosines: c² = 5² + 7² − 2 × 5 × 7 × cos 60° = 25 + 49 − 35 = 39, so c = √39 ≈ 6.245 m.
  3. Angle A: cos A = (7² + 6.245² − 5²) ÷ (2 × 7 × 6.245) ≈ 0.72058, so A ≈ 43.8979°. Then B = 180° − 43.8979° − 60° ≈ 76.1021°.
  4. Heron's formula: s = (5 + 7 + 6.245) ÷ 2 ≈ 9.1225, and the area is √(229.6875) ≈ 15.1554 m².
  5. Perimeter: 5 + 7 + 6.245 ≈ 18.245 m.

Result: The closing fence is about 6.245 m long. The triangle is acute (every angle under 90°) and scalene (no two sides equal), and it encloses about 15.1554 m².

Understanding the result

The longest side always faces the largest angle, and the shortest side faces the smallest. If a result breaks that pattern, you've probably entered a side or angle under the wrong letter.

In the two-answer case, both answers are mathematically correct. Choose between them using something you know about the real shape. For example, you may know whether the angle across from side b is acute or obtuse (over 90°).

The area is in the square of your length unit. Sides in meters give square meters.

Assumptions and limitations

  • The triangle is flat (Euclidean), so its angles add up to exactly 180°.
  • Angles are in degrees, and all sides use the same length unit.
  • Your inputs are taken as exact. Results are rounded only for display.
  • Three angles alone (AAA) set only the shape, not the size, so you need at least one side.
  • Triangles on a sphere, such as long routes across the Earth's surface, follow different rules. They aren't handled here.
  • Angles in radians or grads must be changed to degrees first.

Frequently asked questions

When should I use the law of sines and when the law of cosines?

Use the law of cosines when the angle you know sits between two sides you know, or when you know all three sides. Use the law of sines when you know an angle and the side across from it. That's always true once you know two angles. The calculator picks the right one for the mode you choose.

What is the ambiguous case?

It's the SSA situation: two sides and an angle that isn't between them. Picture side a swinging from the end of side b. If it's too short, it never reaches the base, so there's no triangle. If it just touches, it makes one right triangle. If it's longer than the height but shorter than b, it can land in two places, giving two triangles. If a is at least as long as b, only one triangle fits.

Why does the calculator say no triangle exists?

The measurements don't fit together. Three sides fail if one is at least as long as the other two combined. Two angles fail if they add up to 180° or more. In SSA, side a may be shorter than the height b × sin A. Or the angle you gave may be obtuse while side a isn't the longest side.

How is the area found without a height?

Heron's formula gives the area from the three side lengths alone. So once all three sides are known, you don't need a height. With the default sides of 5, 7 and 8, the semi-perimeter is 10 and the area is √300 ≈ 17.3205.

Can AAA (three angles) be solved?

No. Triangles with the same three angles are similar: they have the same shape but can be any size. Add one side length, and the triangle is fully set.

How this calculator is checked

Method: Law of sines and law of cosines for plane triangles; standard SSA ambiguous-case analysis; Heron's formula in its numerically stable sorted-side form. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.

Embed this calculator

Put this Triangle Solver Calculator on your own website or blog for free. Paste this code where you want it to appear: