Triangle Calculator — Free Online Calculator with Step-by-Step Guide
Solve any triangle using SSS, SAS, or ASA input modes. Computes all sides, angles, area, and perimeter with dynamic SVG visualization.
See it worked out
Example — Side a (opposite A) 5, Side b (opposite B) 6, Side c (opposite C) 7, Side b 6:
Triangle Type
Scalene Acute
Angle A
44.42°
Angle B
57.12°
Angle C
78.46°
Side a
5
Side b
6
Side c
7
Perimeter
18
Area
14.7 sq units
The formula
SSS: cos(A) = (b² + c² − a²)/(2bc) | SAS: a² = b² + c² − 2bc·cos(A) | ASA: a = c·sin(A)/sin(C)
- a, b, c
- Side Lengths
- A, B, C
- Interior Angles
- Area
- Area
Worked example — Side a (opposite A) 5, Side b (opposite B) 6, Side c (opposite C) 7, Side b 6
Triangle Type = Scalene Acute
How Triangle Solver Works
SSS: cos(A) = (b² + c² − a²)/(2bc) | SAS: a² = b² + c² − 2bc·cos(A) | ASA: a = c·sin(A)/sin(C)
The law of cosines relates the sides of a triangle to the cosine of one angle: a² = b² + c² − 2bc·cos(A). It is a generalization of the Pythagorean theorem that works for any triangle, not just right triangles. The law of sines relates side lengths to the sines of their opposite angles: a/sin(A) = b/sin(B) = c/sin(C). Together, these two laws provide everything needed to solve any triangle when given three independent measurements (SSS, SAS, or ASA). The third angle is always found by subtracting the other two from 180° since all interior angles of any triangle sum to 180°.
- a, b, c
- Side Lengths — The three sides of the triangle. Side a is opposite angle A, side b is opposite angle B, and side c is opposite angle C.
- A, B, C
- Interior Angles — The three interior angles of the triangle, always summing to exactly 180° in Euclidean geometry.
- Area
- Area — Computed via Heron's formula: √(s(s−a)(s−b)(s−c)) where s = (a+b+c)/2 is the semi-perimeter.
How to Use
- Select the input mode that matches the information you have: SSS (three side lengths), SAS (two sides plus the angle between them), or ASA (two angles plus the side between them).
- Enter the known measurements in the labeled fields.
- The calculator computes all missing sides, angles, area, and perimeter automatically.
- The SVG visualization draws the triangle to scale with labeled sides, angles, and dimensions.
Understanding the Result
Triangles are the building blocks of geometry. Any polygon can be decomposed into triangles, making triangle-solving a fundamental skill in geometry, surveying, engineering, and computer graphics. Given any three independent measurements (but not only three angles), the triangle is uniquely determined up to congruence — this is the SSS, SAS, ASA, and AAS congruence rules taught in geometry. The law of cosines is a generalization of the Pythagorean theorem: when angle C = 90°, c² = a² + b² − 2ab·cos(90°) = a² + b² (the familiar Pythagorean theorem). For SSS input, the law of cosines finds the first angle, then the law of sines finds the second, and the third is 180° minus the other two. For ASA, the third angle is found first (180° minus the two known angles), then the law of sines finds the unknown sides. This systematic approach ensures accuracy across all input modes.
Frequently Asked Questions
- What is the triangle inequality rule?
- The triangle inequality states that the sum of any two sides must be greater than the third side. If a + b ≤ c, no triangle can exist because the two shorter sides cannot reach across the longest side. This is why SSS input accepts any three positive numbers but may return "no valid triangle" if they violate this fundamental geometric constraint. For example, sides 1, 2, and 5 cannot form a triangle because 1 + 2 < 5.
- Why does SAS use the included angle?
- The "included angle" is the angle between the two known sides. Without it, two different triangles could share the same two side lengths — imagine a hinge opening to different angles. SAS uniquely determines a triangle because fixing the angle between the two known sides forces a specific third side length via the law of cosines. If you have two sides and a non-included angle, that is the SSA case which can produce zero, one, or two possible triangles.
- How do I know which input mode to use?
- Use SSS if you have all three side lengths (common when measuring a physical triangle). Use SAS if you have two sides and the angle between them (common in construction and surveying). Use ASA if you have two angles and the side between them (common in navigation and triangulation). These three patterns cover the most common real-world measurement scenarios. The AAS case (two angles, non-included side) is equivalent to ASA since the third angle can always be found.
- Why does the SVG triangle look different from my sketch?
- The SVG renders the triangle to scale based on the computed side lengths. It may appear rotated or flipped differently than your mental image — this is because the canonical coordinate system places vertex C at the origin and vertex B along the positive x-axis for consistent rendering. The shape, proportions, and all angles are geometrically accurate regardless of orientation.
- What is Heron's formula and when is it used?
- Heron's formula computes the area of a triangle using only its three side lengths: A = √(s(s−a)(s−b)(s−c)), where s = (a+b+c)/2 is the semi-perimeter. This is useful when you know all three sides but not the height. It was discovered by Heron of Alexandria and works for any triangle. For SSS mode, this is the primary method for calculating area. For SAS and ASA modes, area can also be computed directly using A = ½ab·sin(C) since you know two sides and the included angle.
Cite this calculator
TheCalcUniverse. "Triangle Calculator — Free Online Calculator with Step-by-Step Guide." TheCalcUniverse, 2026, https://thecalcuniverse.com/math/triangle-calculator/. Accessed July 24, 2026.
Embed this calculator on your site
You may also like
-
Right Triangle
Solve right triangles using the Pythagorean theorem and SOH CAH TOA trigonometry. Find sides, angles, area, an…
-
Area & Perimeter
Calculate area and perimeter for seven shapes: circle, rectangle, square, triangle, trapezoid, parallelogram, …
-
Circle Calculator
Find radius, diameter, circumference, and area from any single known circle measurement. Shows reverse enginee…
-
Volume & Surface Area
Calculate volume and surface area of spheres, cubes, rectangular prisms, cylinders, cones, and pyramids. Free,…