Skip to content
Everyday Utilities Free • No signup • Instant results

Triangle Calculator

Solve triangles: sides, angles, area, perimeter and type.

About the Triangle Calculator

The triangle calculator takes the lengths of three sides and computes the area, the three interior angles, the perimeter, and the type of triangle (equilateral, isosceles, or scalene; acute, right, or obtuse). Given three side lengths that satisfy the triangle inequality, every other property of the triangle follows from a small set of formulas that the calculator applies automatically.

The area is computed using Heron's formula, which depends only on the side lengths and does not require any angle to be known in advance. The angles are computed using the law of cosines, which generalises the Pythagorean theorem to non-right triangles. Together these formulas let you fully characterise a triangle from its three sides alone.

The triangle inequality — the requirement that the sum of any two sides must exceed the third — is enforced before any calculation. If your inputs violate it, the calculator reports an error rather than producing a meaningless result with an imaginary area or NaN angles.

How It Works

The area is computed using Heron's formula, which uses the semi-perimeter s = (a + b + c) / 2:

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

Heron's formula is remarkable because it computes the area directly from the side lengths without needing to know any height or angle. It was discovered by the Greek mathematician Heron of Alexandria around 60 AD and remains one of the most elegant formulas in elementary geometry.

The angles are computed using the law of cosines, which relates the sides and angles of any triangle:

cos(A) = (b^2 + c^2 - a^2) / (2 * b * c)
cos(B) = (a^2 + c^2 - b^2) / (2 * a * c)
cos(C) = (a^2 + b^2 - c^2) / (2 * a * b)

The third angle follows from the angle-sum property: A + B + C = 180 degrees. The law of cosines reduces to the Pythagorean theorem when angle C is 90 degrees, since cos(90) = 0 makes the equation a^2 + b^2 = c^2. The triangle type is determined by comparing the side lengths (equilateral if all equal, isosceles if two equal, scalene otherwise) and the largest angle (right if 90 degrees, obtuse if greater, acute if less).

Worked Examples

Using the default inputs a = 3, b = 4, c = 5, the calculator recognises a right triangle because 3 squared plus 4 squared equals 5 squared (9 + 16 = 25). The semi-perimeter is (3 + 4 + 5) / 2 = 6, and Heron's formula gives the area as sqrt(6 * 3 * 2 * 1) = sqrt(36) = 6 square units, which matches the familiar half-base-times-height formula for a right triangle.

The angles are computed using the law of cosines. Angle C (opposite side c = 5) is arccos((9 + 16 - 25) / (2 * 3 * 4)) = arccos(0) = 90 degrees, confirming the right angle. Angles A and B are approximately 36.87 and 53.13 degrees, summing to 90 degrees as expected for the two non-right angles of a right triangle.

For an equilateral triangle with a = b = c = 6, the area is sqrt(9 * 3 * 3 * 3) = sqrt(243) = approximately 15.59, and all three angles are 60 degrees. The type is reported as equilateral and acute, matching the symmetry of the input.

When to Use This Tool

Use the triangle calculator whenever you need to analyse a triangle from its sides:

  • Computing the area of a triangular plot of land for surveying or real estate.
  • Determining angles in a truss or structural member for engineering design.
  • Solving geometry problems in a mathematics or engineering course.
  • Verifying that three measured sides form a valid triangle.
  • Finding the missing side or angle when only some values are known.
  • Classifying triangles as acute, right, or obtuse for teaching purposes.
  • Computing the area of a triangular sail, sign, or fabric panel.

Limitations & Disclaimer

This calculator solves triangles given three sides (SSS). It does not handle the SAS, ASA, AAS, or SSA cases, which require different inputs and formulas. The angles are reported in degrees. Very small or very large inputs may lose precision due to floating-point arithmetic, and the law of cosines can be numerically unstable for nearly degenerate triangles. For surveying or engineering work, verify results with dedicated surveying software. See our disclaimer for full details.

Frequently Asked Questions

What is Heron's formula?

Heron's formula computes the area of a triangle directly from its three side lengths, using the semi-perimeter s = (a + b + c) / 2. The area is the square root of s times (s - a) times (s - b) times (s - c). It is remarkable because it requires no angle or height, only the sides.

What is the law of cosines?

The law of cosines generalises the Pythagorean theorem to any triangle. It states that c squared equals a squared plus b squared minus 2ab times the cosine of the included angle. When the angle is 90 degrees, the cosine term vanishes and the law reduces to the familiar a squared plus b squared equals c squared.

What is the triangle inequality?

It states that the sum of any two sides must exceed the third. This is a necessary condition for three lengths to form a triangle. The calculator enforces this before any computation and reports an error if the inequality is violated, preventing meaningless results.

How are the triangle types determined?

By comparing the side lengths and the largest angle. If all three sides are equal, the triangle is equilateral; if two are equal, it is isosceles; otherwise it is scalene. If the largest angle is 90 degrees, it is right; if greater than 90, obtuse; if less, acute. An equilateral triangle is always acute.

Can the calculator handle obtuse triangles?

Yes. The law of cosines works for any valid triangle, acute or obtuse. For an obtuse triangle, the cosine of the obtuse angle is negative, which the formula handles correctly. The triangle type is reported as obtuse when the largest angle exceeds 90 degrees.

Why does the sum of angles equal 180 degrees?

This is a theorem of Euclidean geometry: the three interior angles of any triangle always sum to 180 degrees. The calculator uses this property to derive the third angle from the other two, which is faster and more numerically stable than computing all three independently.

Last updated: July 21, 2026  ·  Author: HT99 Tools Editorial Team  ·  Reviewed by: HT99 Tools Editorial Team