Triangle Calculator — Free Online Triangle Solver
Solve any triangle instantly using five input methods. Calculate all sides, angles, area, perimeter, and heights with Heron's formula, the Law of Cosines, and the Law of Sines.
Triangle Results
Side a
5.0000
Side b
7.0000
Side c
8.0000
Perimeter
20.0000
Angle A
38.21°
Angle B
60.00°
Angle C
81.79°
Area
17.3205 sq units
Height to a
6.9282
Height to b
4.9487
Height to c
4.3301
How to Use the Triangle Calculator
- Select the input method: Choose from five solving methods based on the information you have. SSS requires three side lengths. SAS requires two sides and the angle between them. ASA requires two angles and the side between them. AAS requires two angles and a side not between them. SSA requires two sides and an angle not between them.
- Enter known values: Type your measurements into the three input fields. The labels automatically update to match the selected method. Side lengths must be positive numbers. Angles must be entered in degrees and must be between 0 and 180 degrees. The input fields accept decimal values for precise calculations.
- Review the results: The results panel instantly shows all computed values including all three sides, all three angles, the total area (computed via Heron's formula), the perimeter, and the three altitudes (heights to each side). No button press is needed as results update in real time.
- Validate your triangle: If your input values cannot form a valid triangle (for example, the triangle inequality is violated or the angles sum exceeds 180 degrees), the calculator will display a message indicating that the values are invalid. Adjust your inputs and try again.
When switching between methods, the calculator loads sensible default values so you can immediately see how each method works. Experiment freely with different values and methods to develop your understanding of triangle geometry.
Triangle Formulas
Heron's Formula (Area from Three Sides)
s = (a + b + c) / 2, Area = sqrt(s(s-a)(s-b)(s-c)) Law of Cosines
c² = a² + b² - 2ab x cos(C) Law of Sines
a / sin(A) = b / sin(B) = c / sin(C) Height from Area
h_a = 2 x Area / a Angle Sum Property
A + B + C = 180° Variables Explained
- a, b, c: The three side lengths of the triangle. Side a is opposite angle A, side b is opposite angle B, and side c is opposite angle C. All side lengths must be positive.
- A, B, C: The three interior angles measured in degrees. Each angle must be greater than 0 and less than 180 degrees. Their sum always equals exactly 180 degrees.
- s: The semi-perimeter, equal to half the perimeter. Used in Heron's formula for calculating area from side lengths alone.
- h_a, h_b, h_c: The three altitudes (heights) of the triangle. Each height is measured perpendicular to its corresponding base.
Step-by-Step Example (SSS Method)
Solve a triangle with sides a = 5, b = 7, c = 8:
- Calculate the semi-perimeter: s = (5 + 7 + 8) / 2 = 10
- Apply Heron's formula: Area = sqrt(10 x 5 x 3 x 2) = sqrt(300) = 17.32 sq units
- Find angle A using the Law of Cosines: cos(A) = (7² + 8² - 5²) / (2 x 7 x 8) = 0.7857, so A = 38.21°
- Find angle B: cos(B) = (5² + 8² - 7²) / (2 x 5 x 8) = 0.5, so B = 60°
- Find angle C: C = 180 - 38.21 - 60 = 81.79°
- Calculate heights: h_a = 2 x 17.32 / 5 = 6.93, h_b = 2 x 17.32 / 7 = 4.95, h_c = 2 x 17.32 / 8 = 4.33
Practical Examples
Example 1: Nathan's Backyard Triangular Garden
Nathan is building a triangular garden bed in his backyard. He measured the three sides as 12 feet, 15 feet, and 18 feet. He needs to know the area to calculate how much soil to buy and the angles to cut the border pieces correctly.
- Semi-perimeter: s = (12 + 15 + 18) / 2 = 22.5
- Area = sqrt(22.5 x 10.5 x 7.5 x 4.5) = sqrt(7,971.56) = 89.28 sq ft
- Angles: A = 41.41°, B = 56.25°, C = 82.34°
Nathan needs approximately 89.28 square feet of soil coverage. Since garden soil is typically sold by the cubic foot, he would multiply this area by his desired depth (for example, 89.28 x 0.5 feet = 44.64 cubic feet for 6 inches of soil). The angle measurements help him cut the wooden border pieces at the correct angles.
Example 2: Sarah's Surveying Problem
Sarah is a land surveyor measuring a triangular plot. She can measure two sides as 45 meters and 62 meters, and the included angle between them as 73 degrees (SAS method). She needs the full triangle dimensions for the property boundary report.
- Third side: c = sqrt(45² + 62² - 2 x 45 x 62 x cos(73°)) = sqrt(2025 + 3844 - 1631.4) = 65.10 m
- Perimeter: 45 + 62 + 65.10 = 172.10 m
- Area = (1/2) x 45 x 62 x sin(73°) = 1,334.26 sq m
Sarah can now report the full property boundary: three sides of 45 m, 62 m, and 65.10 m with a total area of 1,334.26 square meters (approximately 0.33 acres). The perimeter of 172.10 meters tells her how much fencing the property would need. For calculating the area of rectangular plots, try our area calculator.
Example 3: Mark's Roof Truss Design
Mark is designing a roof truss. He knows the two base angles are 35 degrees and 55 degrees, and the base (horizontal span) is 24 feet. Using the ASA method, he calculates the rafter lengths and ridge height.
- Third angle: C = 180 - 35 - 55 = 90° (this is a right triangle)
- Side a (opposite 35°): a = 24 x sin(35°) / sin(90°) = 13.77 ft
- Side b (opposite 55°): b = 24 x sin(55°) / sin(90°) = 19.66 ft
- Area: (1/2) x 13.77 x 19.66 = 135.36 sq ft
Mark now knows both rafter lengths (13.77 feet and 19.66 feet) and can cut them accordingly. The 90-degree angle at the ridge confirms this is a right triangle, simplifying his construction. The area of 135.36 square feet helps him estimate roofing materials for each triangular face of the roof.
Example 4: Diana's Navigation Calculation
Diana is hiking and uses triangulation to estimate the distance to a mountain peak. She takes bearings from two points 500 meters apart. The angles from each point to the peak are 72 degrees and 63 degrees (AAS method with A = 72°, B = 63°, a = side opposite 72° is unknown, and the known side c = 500 m is opposite C).
- Third angle: C = 180 - 72 - 63 = 45°
- Distance from first point to peak: a = 500 x sin(72°) / sin(45°) = 672.50 m
- Distance from second point to peak: b = 500 x sin(63°) / sin(45°) = 630.03 m
Diana determines she is approximately 672.50 meters from the mountain peak at her first observation point. This triangulation technique is the same principle used in GPS systems and historical surveying. For right triangle problems specifically, try our right triangle calculator.
Triangle Properties Reference Table
| Triangle Type | Sides | Angles | Special Property | Example |
|---|---|---|---|---|
| Equilateral | a = b = c | All 60° | Maximum symmetry | 5, 5, 5 |
| Isosceles | Two equal | Two equal | Line of symmetry | 5, 5, 8 |
| Scalene | All different | All different | No symmetry | 3, 5, 7 |
| Right | a² + b² = c² | One 90° | Pythagorean theorem | 3, 4, 5 |
| Acute | No constraint | All < 90° | All angles are acute | 5, 6, 7 |
| Obtuse | No constraint | One > 90° | One obtuse angle | 3, 4, 6 |
| Right Isosceles | a = b | 45-45-90 | c = a x sqrt(2) | 1, 1, 1.414 |
| 30-60-90 | 1 : sqrt(3) : 2 | 30-60-90 | Fixed ratio | 1, 1.732, 2 |
Tips and Complete Guide
Choosing the Right Input Method
The key to solving any triangle efficiently is selecting the correct input method. If you know all three sides, SSS is the most straightforward method. If you know two sides and the angle between them, SAS is your best option since it directly uses the Law of Cosines without any ambiguity. ASA and AAS are both excellent when you know two angles because the third angle is immediately determined by subtraction. SSA should be used with caution because it can produce the ambiguous case where two valid triangles exist.
The Triangle Inequality Theorem
Before attempting to solve a triangle using the SSS method, verify that your side lengths satisfy the triangle inequality theorem: the sum of any two sides must be greater than the third side. Specifically, a + b > c, a + c > b, and b + c > a must all be true. For example, sides of 3, 4, and 8 cannot form a triangle because 3 + 4 = 7, which is less than 8. If your values fail this check, the calculator will indicate that no valid triangle exists.
Understanding the Ambiguous Case (SSA)
When using the SSA method, be aware of the ambiguous case. Given sides a and b with angle A opposite side a, there are three possible outcomes. If a is less than b x sin(A), no triangle exists. If a equals b x sin(A), exactly one right triangle exists. If a is between b x sin(A) and b (exclusive), two different triangles are possible. If a is greater than or equal to b, exactly one triangle exists. Understanding these conditions helps you interpret results correctly and recognize when multiple solutions may exist.
Applications in Real Life
Triangle calculations appear everywhere in practical applications. Land surveyors use triangulation to map property boundaries. Architects and engineers rely on triangle geometry for structural analysis, roof design, and bridge construction. Navigation systems use triangulation to determine positions. Astronomers use triangulation (parallax) to measure distances to stars. Artists use triangle composition principles for visual balance. Understanding triangle geometry provides a foundation for these and many other fields.
Common Mistakes to Avoid
- Mixing up degrees and radians: This calculator uses degrees. If your textbook gives angles in radians, convert first: degrees = radians x (180 / pi). For example, pi/6 radians = 30 degrees.
- Violating the triangle inequality: If three sides cannot form a closed triangle (the longest side exceeds the sum of the other two), no solution exists. Always verify this when entering side lengths.
- Ignoring the ambiguous SSA case: When using SSA with an acute angle and certain side lengths, two valid triangles may exist. Check whether your problem context limits the solution to one specific triangle.
- Confusing included vs. non-included sides or angles: In SAS, the angle must be between the two known sides. In ASA, the side must be between the two known angles. Using the wrong relationship leads to incorrect results.
- Rounding too early: When solving multi-step triangle problems by hand, keep full precision in intermediate steps. Rounding intermediate values can compound errors significantly in the final result.
Frequently Asked Questions
Heron's formula calculates a triangle's area using only its three side lengths. First, find the semi-perimeter: s = (a + b + c) / 2. Then compute: Area = sqrt(s(s-a)(s-b)(s-c)). For example, a triangle with sides 5, 7, and 8 has semi-perimeter s = (5+7+8)/2 = 10, and area = sqrt(10 x 5 x 3 x 2) = sqrt(300) = 17.32 square units. Our triangle calculator uses Heron's formula automatically when you select the SSS input method.
These acronyms describe which parts of a triangle are known. SSS means three sides are known. SAS means two sides and the included angle (the angle between them) are known. ASA means two angles and the included side (the side between them) are known. AAS means two angles and a non-included side are known. SSA means two sides and a non-included angle are known. Each method uses different formulas to solve for the remaining parts. Our calculator supports all five methods so you can solve any triangle problem.
The sum of interior angles in any triangle always equals 180 degrees, a fundamental property of Euclidean geometry. This can be proven by drawing a line parallel to one side of the triangle through the opposite vertex. The alternate interior angles formed equal the base angles of the triangle, and the three angles together form a straight line (180 degrees). This property is essential for triangle calculations because knowing two angles immediately gives you the third: C = 180 - A - B.
The Law of Cosines states: c squared = a squared + b squared - 2ab x cos(C), where C is the angle opposite side c. It is used when you know either three sides (SSS) to find an angle, or two sides and the included angle (SAS) to find the third side. It generalizes the Pythagorean theorem, which is actually the Law of Cosines when C = 90 degrees (since cos(90) = 0). Our calculator applies the Law of Cosines automatically for SSS and SAS input methods.
The Law of Sines states: a/sin(A) = b/sin(B) = c/sin(C), meaning the ratio of each side to the sine of its opposite angle is constant. It is used for ASA, AAS, and SSA triangle problems. For ASA, you use it to find the unknown sides after calculating the third angle. For AAS, it works similarly. For SSA, it can produce zero, one, or two valid solutions (the ambiguous case). Our calculator applies the Law of Sines automatically when appropriate.
Yes, the SSA (two sides and a non-included angle) configuration can produce the ambiguous case. When the given angle is acute and the side opposite to it is shorter than the other given side but longer than the height, two valid triangles exist. For example, if a = 8, b = 12, and angle A = 30 degrees, both angle B = 48.59 degrees and angle B = 131.41 degrees produce valid triangles. Our calculator returns the first valid solution. If you suspect an ambiguous case, try both supplementary angles for verification.
The height (altitude) of a triangle from a given base equals twice the area divided by the base length: h_a = 2 x Area / a. For example, if a triangle has an area of 20 square units and base a = 8 units, the height to base a is h = 2 x 20 / 8 = 5 units. Our triangle calculator computes all three heights (to each side) automatically. This relationship comes directly from the basic area formula: Area = (1/2) x base x height.
This calculator solves any valid triangle: equilateral (all sides equal), isosceles (two sides equal), scalene (no equal sides), acute (all angles under 90 degrees), right (one 90-degree angle), and obtuse (one angle over 90 degrees). It computes all sides, all angles, the area, the perimeter, and all three heights. Simply choose the input method that matches the information you have and enter the known values.
The calculator uses standard IEEE 754 double-precision floating-point arithmetic, providing approximately 15-16 significant digits of precision. Results are displayed to 4 decimal places for practical use. The trigonometric functions (sin, cos, acos, asin) are computed using JavaScript's built-in Math library, which follows the IEEE standard. For educational purposes and most engineering applications, this level of precision is more than sufficient. For surveying or scientific work requiring higher precision, consider specialized software with arbitrary-precision arithmetic.
Related Calculators
Right Triangle Calculator
Solve right triangles with the Pythagorean theorem and trigonometric ratios.
Area Calculator
Calculate the area of various shapes including rectangles, triangles, and circles.
Pythagorean Theorem Calculator
Find any side of a right triangle using the Pythagorean theorem.
Perimeter Calculator
Calculate the perimeter of various geometric shapes.
Scientific Calculator
Advanced calculations with trigonometric functions for triangle problems.
Square Footage Calculator
Calculate area in square feet for construction and real estate projects.
Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.
Last updated: February 23, 2026
Sources
- Khan Academy — Geometry: khanacademy.org
- Math is Fun — Triangles: mathsisfun.com
- National Institute of Standards and Technology (NIST) — SI Units: nist.gov