How to Use This Triangle Calculator
Our online triangle solver instantly computes all missing properties of any triangle based on the values you provide. Whether you are a student checking homework, a teacher preparing lesson materials, or a professional working on construction or engineering problems, this tool provides accurate results with a visual diagram for clarity.
- Enter known values — Fill in any combination of sides (a, b, c) and angles (A, B, C) that you know. You only need 3 values to define a unique triangle (with the constraint that the sum of any two sides must be greater than the third).
- Click the Calculate button — The solver will automatically detect which input method applies (SSS, SAS, ASA, or AAS) and compute the remaining sides, angles, area, and perimeter.
- Review the visual diagram — An interactive canvas renders the solved triangle to scale, showing side lengths, angle values, and vertex labels so you can verify the result visually.
- Start over anytime — Use the Reset button to clear inputs and begin a new calculation.
Example: Try the 3-4-5 Right Triangle
Enter side a = 3, side b = 4, and side c = 5. The calculator will instantly confirm this is a right-angled triangle with angles of approximately 36.87°, 53.13°, and 90°, an area of 6.0 square units, and a perimeter of 12. This classic Pythagorean triple is often used in construction and carpentry to mark perfectly square corners.
Triangle Types and Their Properties
Triangles are classified based on the lengths of their sides and the measure of their interior angles. Understanding these classifications helps in geometry problem-solving and real-world applications.
Classification by Side Length
Equilateral Triangle
All three sides are equal in length, and all three angles measure exactly 60°. An equilateral triangle is also equiangular and has three lines of symmetry.
Isosceles Triangle
Exactly two sides are equal in length, and the angles opposite those sides (called base angles) are equal. The altitude to the unequal side bisects both the base and the vertex angle.
Scalene Triangle
All three sides have different lengths, and all three angles have different measures. No symmetry axes exist in a scalene triangle.
Classification by Interior Angles
Right-Angled Triangle
Contains one angle of exactly 90°. The side opposite the right angle is called the hypotenuse — it is always the longest side. Follows the Pythagorean theorem: a² + b² = c².
Acute-Angled Triangle
All three interior angles measure less than 90°. In an acute triangle, the square of each side is less than the sum of the squares of the other two sides.
Obtuse-Angled Triangle
Contains one angle greater than 90° but less than 180°. In an obtuse triangle, the square of the longest side is greater than the sum of the squares of the other two sides.
The Angle Sum Property
A fundamental rule of Euclidean geometry: in any triangle, the sum of the three interior angles is always exactly 180 degrees (or π radians). This means if you know two angles, you can always find the third by subtracting their sum from 180°.
Triangle Calculation Formulas Explained
Behind the scenes, this calculator uses classical trigonometric laws and geometric formulas to solve triangles. Here is a reference for the mathematics involved:
The Law of Cosines (SSS and SAS Cases)
The Law of Cosines extends the Pythagorean theorem to triangles that are not right-angled. For any triangle with sides a, b, c and corresponding opposite angles A, B, C:
c² = a² + b² − 2ab × cos(C)
This formula is used when you know all three sides (SSS) and need to find the angles, or when you know two sides and the included angle (SAS) and need to find the third side.
The Law of Sines (ASA and AAS Cases)
The Law of Sines states that the ratio of each side length to the sine of its opposite angle is constant for all three sides in any given triangle:
a/sin(A) = b/sin(B) = c/sin(C)
This is particularly useful when you know two angles and one side (ASA or AAS configurations), since you can derive the third angle from the 180° sum rule and then compute the remaining sides.
Area Using Heron's Formula
When all three sides are known, Heron's Formula provides an elegant way to compute the area without needing to calculate any angles first. Given sides a, b, c, and the semi-perimeter s = (a + b + c)/2:
Area = √[ s(s − a)(s − b)(s − c) ]
This is the method our calculator uses for area computation when solving from SSS inputs. For other configurations, the calculator first derives all three sides, then applies Heron's formula for consistency.
Perimeter
Perimeter = a + b + c
The Triangle Inequality Theorem
For three positive lengths to form a valid triangle, the sum of any two sides must be strictly greater than the third side. Mathematically, for sides a, b, c:
- a + b > c
- a + c > b
- b + c > a
If these conditions are not met, no triangle can be formed. Our calculator validates this automatically and displays an error message when your inputs cannot form a valid geometric triangle.
Step-by-Step Solved Examples
Seeing the formulas applied to concrete numbers is the fastest way to build real understanding. Below are two complete worked examples — one starting from three sides (SSS) and one starting from two angles and a side (AAS). Each walks through the same calculations our calculator performs in the background.
Example 1 — Solving from Three Sides (SSS): a = 5, b = 7, c = 8
Suppose you need to solve a triangle with sides 5, 7, and 8 units long. Here is exactly how the values are computed.
Step 1 — Verify the triangle is valid. Check the Triangle Inequality Theorem:
- a + b > c → 5 + 7 = 12 > 8 ✓
- a + c > b → 5 + 8 = 13 > 7 ✓
- b + c > a → 7 + 8 = 15 > 5 ✓
All three conditions hold, so a valid triangle can be formed.
Step 2 — Find the largest angle using the Law of Cosines. The largest angle sits opposite the longest side. Here side b = 7 is not the longest — side c = 8 is. Therefore angle C (opposite side c) is the largest angle:
c² = a² + b² − 2ab × cos(C)
Plugging in the known values and rearranging to solve for cos(C):
cos(C) = (a² + b² − c²) / (2ab) = (25 + 49 − 64) / (2 × 5 × 7) = 10 / 70 ≈ 0.1429
Taking the inverse cosine gives angle C ≈ 81.79°.
Step 3 — Find the second angle using the Law of Cosines. Next, find angle A (opposite side a = 5):
cos(A) = (b² + c² − a²) / (2bc) = (49 + 64 − 25) / (2 × 7 × 8) = 88 / 112 ≈ 0.7857
Angle A ≈ arccos(0.7857) ≈ 38.21°.
Step 4 — Find the third angle from the 180° sum rule.
Angle B = 180° − 38.21° − 81.79° = 60.00°
Step 5 — Calculate the perimeter.
Perimeter = a + b + c = 5 + 7 + 8 = 20 units
Step 6 — Calculate the area using Heron's Formula.
First compute the semi-perimeter s:
s = (5 + 7 + 8) / 2 = 10
Then apply Heron's formula:
Area = √[10 × (10 − 5) × (10 − 7) × (10 − 8)] = √(10 × 5 × 3 × 2) = √300 ≈ 17.32 square units
Final Answer: Angles ≈ 38.21°, 60.00°, 81.79° — Perimeter = 20 — Area ≈ 17.32 — Triangle type: acute scalene.
Example 2 — Solving from Two Angles and a Side (AAS): Angle A = 35°, Angle B = 65°, Side a = 10
This time you know two interior angles and the side opposite the first angle. The calculator follows this path:
Step 1 — Find the third angle using the 180° sum rule.
Angle C = 180° − 35° − 65° = 80°
Step 2 — Find the remaining sides using the Law of Sines. The Law of Sines tells us a/sin(A) = b/sin(B) = c/sin(C). First, compute the common ratio:
a/sin(A) = 10 / sin(35°) ≈ 10 / 0.5736 ≈ 17.43
Now apply this ratio to find sides b and c:
Side b = 17.43 × sin(65°) ≈ 17.43 × 0.9063 ≈ 15.80 units
Side c = 17.43 × sin(80°) ≈ 17.43 × 0.9848 ≈ 17.17 units
Step 3 — Calculate the perimeter.
Perimeter = 10 + 15.80 + 17.17 ≈ 42.97 units
Step 4 — Calculate the area using Heron's Formula.
s = (10 + 15.80 + 17.17) / 2 ≈ 21.485
Area = √[21.485 × 11.485 × 5.685 × 4.315] ≈ 77.79 square units
Final Answer: Sides ≈ 10.00, 15.80, 17.17 — Third angle = 80.00° — Perimeter ≈ 42.97 — Area ≈ 77.79 — Triangle type: acute scalene.
You can verify both examples by entering the starting values into the calculator at the top of the page. The computed values will match these results within standard rounding precision.
Supported Input Configurations
A triangle is uniquely determined by 3 independent pieces of information (with some restrictions). Our calculator automatically recognizes which of the following configurations you are providing and applies the appropriate solving method.
SSS — Three Sides
What to enter: Values for all three sides (a, b, c). What it tells us: This uniquely determines the shape and size of the triangle. All angles can be computed using the Law of Cosines. The triangle must satisfy the Triangle Inequality Theorem to be geometrically valid.
SAS — Two Sides and the Included Angle
What to enter: Any two sides plus the angle that lies exactly between them (for example, sides a and b plus angle C). What it tells us: This configuration is well-suited to the Law of Cosines, which directly gives the third side, after which the SSS method completes the solution.
ASA — Two Angles and the Included Side
What to enter: Any two angles plus the side that lies exactly between them (for example, angles A and B plus side c). What it tells us: The third angle follows immediately from the 180° angle sum. The Law of Sines then yields the remaining two side lengths.
AAS — Two Angles and a Non-Included Side
What to enter: Any two angles plus a side that is opposite one of them (for example, angles A and B plus side a). What it tells us: This is closely related to the ASA case — the third angle is computed first, then the Law of Sines determines the remaining sides.
Not Supported (Ambiguous Cases)
The SSA configuration (two sides and a non-included angle) is intentionally not accepted because it can yield zero, one, or two distinct valid triangles depending on the input. For reliable, unambiguous results, please use one of the four supported configurations above.
Practical Applications of Triangle Calculations
Triangle mathematics finds uses across many fields. Here are some of the most common applications that our calculator can help with:
- Construction and Carpentry: Marking square corners using the 3-4-5 method, calculating roof rafter lengths, and determining stair dimensions rely on right-triangle math.
- Surveying and Land Measurement: Surveyors use trigonometry to compute distances across obstacles like rivers or buildings without physically measuring them.
- Navigation and Aviation: Pilots and sailors use triangle calculations to determine course corrections, distances between waypoints, and headings relative to wind or current.
- Architecture and Structural Engineering: Triangles are the strongest two-dimensional shape — trusses, bridges, and towers all rely on triangular geometry for stability.
- Graphics, Game Development, and Computer Vision: 3D modeling, ray tracing, perspective transforms, and face detection all use triangular geometry extensively.
- Academic and Homework Help: Students and teachers use triangle calculators to verify geometry homework, prepare test materials, and visualize abstract concepts.
For all of these use cases, our calculator provides precise results, displaying all four sides and angles, the area, the perimeter, and the triangle classification type in real time.
Frequently Asked Questions
Q: Why does the calculator say my triangle is invalid?
A: This happens when your input values violate the Triangle Inequality Theorem — the sum of any two sides must be strictly greater than the third side, or no closed shape can be formed. Check that you have entered values correctly and try again.
Q: How precise are the calculated values?
A: Results are computed using standard JavaScript double-precision floating-point arithmetic (approximately 15-16 significant digits) and displayed rounded to 4 decimal places. For most practical purposes this is more than sufficient.
Q: In what unit should I enter the sides?
A: You can use any unit you wish — centimeters, meters, feet, inches, kilometers, or miles. The calculator does not interpret units; it treats all inputs as pure numerical values. Outputs will be in the same unit system you used for inputs.
Q: What unit are the angle values in?
A: All angle inputs and outputs are in degrees. The calculator does not support radians for user-facing input or output, though internal computations follow standard trigonometric conventions.
Q: Can I solve right-angled triangles with this tool?
A: Yes. A right-angled triangle is simply treated as a general triangle with one 90° angle. You can enter two sides, or one side and one acute angle, and the calculator will complete the solution.
Q: Is this calculator free to use?
A: Yes. This online triangle calculator is completely free for personal, educational, and professional use. No registration or login is required.
Q: Does the calculator store or send my input data anywhere?
A: No. All calculations are performed directly in your web browser using client-side JavaScript. Your inputs never leave your device, and no data is collected or transmitted to any server.
Q: Why is the SSA configuration not supported?
A: The SSA (two sides and a non-included angle) case is ambiguous because it can produce zero, one, or two valid solutions depending on the input values. For example, if side a is shorter than side b, there are two different triangles that satisfy the same SSA constraints. Rather than guess which solution you want, the calculator requires one of the four unambiguous configurations (SSS, SAS, ASA, or AAS).
Q: What is the difference between ASA and AAS?
A: In ASA you know two angles and the side that sits exactly between them (the included side). In AAS you know two angles and a side that is NOT between them — for example, two angles and the side opposite the first angle. Both configurations are solvable with the Law of Sines, and our calculator accepts either one automatically.
Q: Can I enter very small or very large values?
A: Yes. The calculator uses standard double-precision floating-point arithmetic, which handles values from approximately 2.2 × 10⁻³⁰⁸ up to about 1.8 × 10³⁰⁸. For very small or very large inputs, the calculator may display results in scientific notation. Note that extreme ratios between side values can reduce the numerical precision of the angle calculations.
Q: How does the visual diagram work?
A: The diagram is drawn using the HTML5 Canvas API. After the calculator determines all three sides, it places the first vertex of the triangle at the origin and the second vertex along the horizontal axis. The position of the third vertex is computed from the side lengths using trigonometry, and the resulting figure is rendered to scale inside the canvas. The diagram is redrawn each time you click the Calculate button.
Q: Do I need to install any software to use the calculator?
A: No software installation is required. The calculator runs inside your web browser on any device with a modern browser — including desktop computers, laptops, tablets, and smartphones. Simply visit the page in your browser and start calculating.
About This Triangle Calculator
This free online geometry tool is designed and maintained by XinYuMaTou to make triangle calculations fast, accurate, and visually intuitive. By combining classical trigonometric laws — the Law of Sines, the Law of Cosines, and Heron's formula — with an interactive canvas visualizer, the calculator gives users both numerical answers and an immediate graphical understanding of the solved triangle.
The tool is built with standard web technologies (HTML, CSS, and vanilla JavaScript) and runs entirely on the client side, meaning no server round-trip is required to compute results. This design choice ensures fast responsiveness and preserves user privacy — no personal data is collected, transmitted, or stored.
Contact
If you have questions about the calculator, suggestions for improvements, or bug reports, please reach out via email at xin_yu@7986455.xyz. We welcome feedback from students, teachers, engineers, and anyone who finds this tool useful.