Free to Use

Triangle Calculator

Solve any triangle using Side-Side-Side (SSS), Angle-Side-Angle (ASA), or Side-Angle-Side (SAS) methods. Get all angles, sides, area, and perimeter with detailed step-by-step solutions.

A B C a b c
Enter all three side lengths. The calculator will check if the triangle is valid using the triangle inequality theorem.
Enter two angles and the side between them. The third angle is automatically calculated.
Enter two sides and the included angle (the angle between them).

Triangle Calculation Examples

🔷 SSS Example: A Triangle with Sides 5, 6, 7

Given: side a = 5, side b = 6, side c = 7

Step 1 — Check validity: 5+6 > 7 ✓, 6+7 > 5 ✓, 5+7 > 6 ✓ → Triangle is valid.

Step 2 — Semiperimeter: s = (5+6+7)/2 = 9

Step 3 — Area (Heron's formula): √(9×4×3×2) = √216 = 14.697 sq units

Step 4 — Angle A: cos A = (6²+7²-5²)/(2×6×7) = 60/84 = 0.714 → A = 44.42°

Step 5 — Angle B: cos B = (5²+7²-6²)/(2×5×7) = 38/70 = 0.543 → B = 57.12°

Step 6 — Angle C: cos C = (5²+6²-7²)/(2×5×6) = 12/60 = 0.200 → C = 78.46°

Perimeter: 5+6+7 = 18 units

🔶 ASA Example: Angle A=50°, Angle B=60°, Side c=8

Given: A = 50°, B = 60°, side c = 8 (between A and B)

Step 1 — Angle C: C = 180° - 50° - 60° = 70°

Step 2 — Side a (Law of Sines): a = 8 × sin(50°)/sin(70°) = 8 × 0.7660/0.9397 = 6.52 units

Step 3 — Side b (Law of Sines): b = 8 × sin(60°)/sin(70°) = 8 × 0.8660/0.9397 = 7.37 units

Step 4 — Area: 0.5 × a × b × sin(C) = 0.5 × 6.52 × 7.37 × sin(70°) = 22.58 sq units

Perimeter: 6.52 + 7.37 + 8 = 21.89 units

🔺 SAS Example: Side a=5, Side b=7, Angle C=45°

Given: a = 5, b = 7, included angle C = 45°

Step 1 — Side c (Law of Cosines): c² = 5² + 7² - 2×5×7×cos(45°) = 25+49-70×0.7071 = 74-49.50 = 24.50

c = √24.50 = 4.95 units

Step 2 — Angle A (Law of Sines): sin A = 5×sin(45°)/4.95 = 5×0.7071/4.95 = 0.714 → A = 45.56°

Step 3 — Angle B: B = 180° - 45° - 45.56° = 89.44°

Step 4 — Area: 0.5 × 5 × 7 × sin(45°) = 0.5 × 35 × 0.7071 = 12.37 sq units

Perimeter: 5 + 7 + 4.95 = 16.95 units

Triangle Formulas & Guide

A triangle is a three-sided polygon with three angles that always sum to 180°. Our calculator supports three common solution methods depending on which measurements you know.

1. SSS: Law of Cosines

cos A = (b² + c² − a²) / (2bc)
Calculate each angle after all three sides are known. Use the inverse cosine function to get the angle in degrees.
Area = √( s(s−a)(s−b)(s−c) )
Heron's formula: where s = (a+b+c)/2 is the semiperimeter.

2. ASA: Law of Sines

a / sin(A) = b / sin(B) = c / sin(C)
When two angles and a side are known, compute the third angle (A+B+C=180°), then use the Law of Sines to find the remaining sides.
C = 180° − A − B
The third angle is simply 180° minus the sum of the two known angles.

3. SAS: Law of Cosines

c² = a² + b² − 2ab · cos(C)
Find the third side using the two known sides and the included angle, then use the Law of Sines or Law of Cosines for the remaining angles.

Area Formulas

Area = ½ × a × b × sin(C)
Using two sides and the included angle. Equivalent to: ½ × b × c × sin(A) = ½ × a × c × sin(B).

Triangle Inequality Theorem

For any triangle with sides a, b, and c:

a + b > c   b + c > a   a + c > b
All three conditions must be true for a valid triangle. If any condition fails, the side lengths cannot form a triangle.

How to Solve a Triangle (General Method)

1
Identify what's known: Determine if you have SSS, ASA, or SAS.
2
Find missing angle: If two angles are known, the third is 180° minus their sum.
3
Apply Law of Cosines: Use to find an angle from three sides, or the third side from two sides and the included angle.
4
Apply Law of Sines: Use the proportion a/sin(A) = b/sin(B) = c/sin(C) to find remaining sides or angles.
5
Calculate area: Use Heron's formula (if all sides known) or ½ab·sin(C) (if two sides and included angle known).
6
Calculate perimeter: Sum all three side lengths.

Quick Tips

📏 Always Check Validity

Before calculating, verify that three sides satisfy the triangle inequality theorem. A triangle with sides 1, 2, and 4 is impossible.

🔄 Degrees vs Radians

JavaScript's Math.sin() and Math.cos() use radians. Always convert degrees to radians (multiply by π/180) for correct results.

🔢 Angle Sum Check

Always verify that the three angles sum to 180°. Small rounding differences (e.g., 179.99°) are normal in floating-point calculations.

📐 Units Matter

All side lengths must use the same unit. Mixing meters and centimeters will give incorrect results. The area will be in square units of whatever unit you use.

🔷
SSS Triangle Solver
Enter all three side lengths and instantly get all angles using the Law of Cosines, plus area via Heron's formula, perimeter, and semiperimeter.
🔶
ASA Triangle Solver
Know two angles and a side? The ASA mode calculates the third angle and uses the Law of Sines to find the remaining sides and area.
🔺
SAS Triangle Solver
Given two sides and the included angle, find the third side using the Law of Cosines, then the remaining angles and area.
📝
Step-by-Step Solutions
See every calculation step — from triangle inequality validation to Law of Cosines, Law of Sines, and Heron's formula — explained clearly.

What Is a Triangle?

A triangle is a three-sided polygon that is one of the fundamental shapes in geometry. Every triangle has three sides, three angles, and three vertices. The sum of its interior angles is always 180 degrees (or π radians), regardless of the triangle's shape or size.

Triangles can be classified by their side lengths (equilateral, isosceles, scalene) or by their angles (acute, right, obtuse). Our calculator works with any triangle type — simply choose the data you have available.

Triangle Classification

Why Triangle Calculations Matter

Triangle calculations are essential in many fields: engineering (truss design, forces), architecture (roof angles, structural loads), navigation (triangulation, GPS), computer graphics (3D rendering, mesh generation), surveying (distance measurement), and physics (vector components, force analysis).

How to Use the Triangle Calculator

Our Triangle Calculator makes it easy to solve any triangle using three common methods. Here's how each mode works:

SSS Mode (Side-Side-Side)

When to use: You know all three side lengths of a triangle but need to find the angles and area.

How it works: The calculator first checks if the side lengths satisfy the triangle inequality theorem (a+b>c, b+c>a, a+c>b). If valid, it uses the Law of Cosines to find each angle, Heron's formula to find the area, and sums the sides for the perimeter.

ASA Mode (Angle-Side-Angle)

When to use: You know two angles and the side between them. This is common in surveying and navigation.

How it works: The third angle is found by subtracting the known angles from 180°. Then the Law of Sines is used to calculate the two unknown sides. Area is found using ½·ab·sin(C).

SAS Mode (Side-Angle-Side)

When to use: You know two sides and the angle between them. This is common in construction and engineering.

How it works: The Law of Cosines finds the third side. Then the Law of Sines finds the smaller of the two remaining angles, and the third angle is 180° minus the sum of the known ones.

Applications of Triangle Calculations

🏗️ Construction & Engineering

Truss bridges, roof rafters, and scaffolding all rely on triangular structures for strength. Triangle calculations ensure correct fit and load distribution.

🗺️ Surveying & Mapping

Surveyors use triangulation to measure distances and create maps. By measuring angles and a baseline distance, they can calculate unknown distances.

🎮 Computer Graphics

3D models are built from thousands of triangles (polygons). Rendering engines use triangle calculations for lighting, shading, and perspective projection.

🛰️ Navigation & GPS

GPS satellites use triangulation to determine your position. Knowing distances to multiple satellites (spheres of position) pinpoints your exact location.

Frequently Asked Questions

What is the triangle inequality theorem?
The triangle inequality theorem states that the sum of any two sides of a triangle must be greater than the third side. For sides a, b, and c: a+b > c, b+c > a, and a+c > b. If any of these conditions is not met, the side lengths cannot form a triangle. For example, sides 1, 2, and 4 cannot form a triangle because 1+2 < 4.
What is the Law of Cosines and when do I use it?
The Law of Cosines relates the sides of a triangle to the cosine of one of its angles: c² = a² + b² - 2ab·cos(C). Use it when you know (1) all three sides (SSS) to find an angle, or (2) two sides and the included angle (SAS) to find the third side. It's a generalization of the Pythagorean theorem that works for any triangle, not just right triangles.
What is the Law of Sines and when do I use it?
The Law of Sines states that the ratio of a side length to the sine of its opposite angle is constant for all three sides: a/sin(A) = b/sin(B) = c/sin(C) = 2R (where R is the circumradius). Use it when you know (1) two angles and a side (ASA or AAS), or (2) two sides and a non-included angle (SSA, which may have ambiguous cases). It's simpler than the Law of Cosines when you have angle information.
What is Heron's formula for triangle area?
Heron's formula calculates the area of a triangle when all three sides are known. First, calculate the semiperimeter s = (a+b+c)/2. Then area = √(s(s-a)(s-b)(s-c)). For example, for a triangle with sides 5, 6, 7: s = 9, area = √(9×4×3×2) = √216 ≈ 14.70 square units. This formula works for any triangle, even if you don't know its height.
What's the difference between SSS, ASA, and SAS?
These are congruence conditions — sets of measurements that uniquely define a triangle. SSS (Side-Side-Side): all three sides. ASA (Angle-Side-Angle): two angles and the included side. SAS (Side-Angle-Side): two sides and the included angle. Each uniquely determines the triangle's shape and size. Our calculator supports all three methods so you can work with whatever measurements you have.
How do I convert between degrees and radians for triangle calculations?
JavaScript's Math.sin(), Math.cos(), and other trigonometric functions use radians, not degrees. To convert: radians = degrees × π / 180. To convert back: degrees = radians × 180 / π. Our calculator handles these conversions automatically — you simply enter angles in degrees, and the JavaScript code converts them to radians internally for accurate calculations.

⚠️ Important Note: This Triangle Calculator is for educational and informational purposes only. While every effort has been made to ensure accuracy, results should be verified independently for critical applications such as construction, engineering, surveying, or navigation. Always consult a qualified professional for triangle-related decisions in high-stakes contexts.