Home / Triangle Calculator

Triangle Calculator

Enter any combination of sides and angles that defines a triangle (SSS, SAS, ASA, or AAS) to find all missing values. The calculator shows which rule it applied, then computes area by Heron's formula and perimeter.

Enter known values

Sides a, b, c are opposite to angles A, B, C respectively. Angles are in degrees. Leave unknowns blank. At least one side is required.

Result

Method used--
Side a--
Side b--
Side c--
Angle A--
Angle B--
Angle C--
Area (Heron)--
Perimeter--
Enter values above and press Solve.

Real-World Uses

A general triangle has three sides (a, b, c) and three angles (A, B, C), and unlike a right triangle none of them has to be 90 degrees. Surveyors triangulate land boundaries this way, measuring two known points and an angle to a third. Navigators use the same math to fix a ship's position from two shore landmarks. Engineers rely on it to check truss geometry where none of the supporting beams meet at a right angle. Three independent values are enough to determine the whole triangle, provided at least one of them is a side, and the calculator above picks the correct method automatically based on which three you enter.

How It's Calculated

Law of cosines (SSS and SAS)

c² = a² + b² - 2ab cos C

Use it to find a missing side when two sides and the included angle are known (SAS), or to find any angle when all three sides are known (SSS). Rearranged for angle: cos C = (a squared + b squared - c squared) / (2ab).

Law of sines (ASA and AAS)

a / sin A = b / sin B = c / sin C

Use it when a side and its opposite angle are both known. Given ASA (two angles and the side between them) or AAS (two angles and a non-included side), the law of sines resolves the triangle in one step.

Heron's formula for area

s = (a + b + c) / 2     Area = sqrt(s(s-a)(s-b)(s-c))

Once all three sides are found, s is the semi-perimeter and the area follows without needing a height.

Worked Example: SSS with a = 7, b = 10, c = 5

Step 1. Find angle A (law of cosines). cos A = (b squared + c squared - a squared) / (2bc) = (100 + 25 - 49) / (2 x 10 x 5) = 76 / 100 = 0.76. A = arccos(0.76) = 40.54 degrees.
Step 2. Find angle B (law of cosines). cos B = (a squared + c squared - b squared) / (2ac) = (49 + 25 - 100) / (2 x 7 x 5) = -26 / 70 = -0.3714. B = arccos(-0.3714) = 111.8 degrees.
Step 3. Angle C. C = 180 - 40.54 - 111.8 = 27.66 degrees.
Step 4. Area (Heron). s = (7 + 10 + 5) / 2 = 11. Area = sqrt(11 x 4 x 1 x 6) = sqrt(264) = 16.25.
Step 5. Perimeter. 7 + 10 + 5 = 22.

Common Mistakes to Avoid

The most common error is trying to apply the law of sines to an SAS or SSS setup, where it cannot be used first; those two cases need the law of cosines to get started, and the law of sines only takes over once one angle is known. With SSA (two sides and a non-included angle), watch for the ambiguous case: two different triangles can satisfy the same three values, and the calculator flags it when that happens rather than silently picking one. Also double-check the triangle inequality before trusting an SSS result; three lengths that do not satisfy a + b greater than c cannot form a triangle at all.

If your triangle has a right angle, the right triangle calculator is faster since it skips the law of cosines entirely.

For a formal treatment of the laws of sines and cosines, see Wolfram MathWorld's page on the law of cosines.

Nearby geometry tools

Right angle in play, or need to check the spread of a data set instead?

On this page

Triangle calculator FAQs

How do you solve a triangle given three sides (SSS)?

Use the law of cosines. For angle A: cos A = (b squared + c squared minus a squared) / (2bc). Repeat for a second angle, then get the third by subtracting both from 180. The calculator does this automatically for SSS inputs.

How do you find the area of a triangle with three sides?

Use Heron's formula. Compute s = (a + b + c) / 2, then area = sqrt(s times (s minus a) times (s minus b) times (s minus c)). No height is required, just the three side lengths.

What is the law of sines?

a / sin A = b / sin B = c / sin C. All three ratios are equal. This resolves the triangle when a side and its opposite angle are both known alongside one other value (ASA, AAS, or SSA cases).

What is the law of cosines?

c squared = a squared + b squared minus 2ab cos C. It is the general form of the Pythagorean theorem that applies to any triangle. Use it for SSS (finding an angle) and SAS (finding the third side).

Can you solve a triangle with only angles?

No. Angles alone fix shape but not size. An unlimited number of similar triangles share the same angles. You need at least one side length to lock in a scale and return numeric answers.

What is the triangle inequality?

Each side must be less than the sum of the other two: a + b greater than c, a + c greater than b, b + c greater than a. If any of these fails, the three values cannot form a real triangle.

Marcus Vance
About the author
Marcus Vance
Contributing Writer, Technology & Data, Encore Editorial

Marcus Vance spent a decade building data pipelines and testing calculation logic before he started writing about the math behind the tools. On MathCalcTools he checks every formula against the source math, then writes out the steps so a reader can follow the same path a calculator takes.