Skip to content

Triangle Calculator

Compute area (Heron's formula), perimeter, all three angles, and three altitudes for any triangle from its three side lengths.

What this calculator gives you

Three side lengths in. Out comes:

  • Area via Heron’s formula (works for any triangle, no angle needed)
  • Perimeter (just the sum of sides)
  • All three interior angles in degrees, computed via Law of Cosines
  • All three altitudes (perpendicular heights from each side to the opposite vertex)
  • Triangle type: scalene/isosceles/equilateral plus right/acute/obtuse

The calculator validates the triangle inequality first, for any real triangle, the sum of any two sides has to be greater than the third side. If the sides you entered don’t satisfy this, no valid triangle exists and the calculator says so.

Heron’s formula

Most people learn area = ½ × base × height. That requires knowing the height. When all you have is three side lengths, Heron’s formula is the answer:

s = (a + b + c) / 2          ← semi-perimeter
area = √(s(s-a)(s-b)(s-c))

Heron worked this out in the 1st century AD. The formula is exact for any triangle and doesn’t require any trigonometry or angle measurement. The calculator uses it directly.

For very thin triangles (one angle near 0° or near 180°), Heron’s formula can lose numerical precision because of catastrophic cancellation in floating-point math. The calculator handles common cases correctly; degenerate triangles (where two sides almost equal the third) get area near zero, which is correct.

Law of Cosines for angles

Once you know all three sides, each angle pops out from the Law of Cosines:

  • cos(A) = (b² + c² − a²) / (2bc)
  • cos(B) = (a² + c² − b²) / (2ac)
  • cos(C) = (a² + b² − c²) / (2ab)

Take the inverse cosine (arccos) of each fraction to get the angle in radians; multiply by 180/π for degrees. The three angles always sum to exactly 180° in a valid Euclidean triangle.

Triangle classifications

By sides:

  • Equilateral: all three sides equal (60° angles all around)
  • Isosceles: two sides equal
  • Scalene: all three sides different

By angles:

  • Acute: all angles less than 90°
  • Right: one angle exactly 90°
  • Obtuse: one angle greater than 90°

The calculator detects both axes, you might get “Isosceles, Right” (a 45-45-90 triangle) or “Scalene, Obtuse.”

Altitudes (heights)

The altitude from a vertex to the opposite side is the perpendicular distance from the vertex to that side, extended if necessary. For a 6-8-10 right triangle, the altitudes from the 90° vertex to the hypotenuse is 4.8, while the legs themselves serve as altitudes for the other two angles.

Three altitudes always intersect at a single point called the orthocenter, which lies inside the triangle for acute triangles, on the right-angle vertex for right triangles, and outside for obtuse triangles.

Common applications

  • Land surveying: computing acreage from boundary measurements (Heron’s formula was originally developed for land taxation in ancient Egypt and Greece)
  • Construction: laying out non-rectangular spaces, Heron’s formula gives floor area from three measured walls
  • Sailing: triangulation for navigation, knowing distances to two landmarks gives your position
  • Computer graphics: triangle area for shading and rendering, angle computation for collision detection

Frequently asked questions

What if I only know two sides and an angle? Use the Law of Cosines manually to compute the third side first: c² = a² + b² − 2ab·cos(C). Then enter the three sides into this calculator.

Why does my answer differ from my school’s answer slightly? Floating-point precision. The calculator shows up to 4 decimal places. If you’re checking against a textbook answer to two decimals, round before comparing.

What if I have two angles and one side? You’d need to compute the missing side using the Law of Sines: a/sin(A) = b/sin(B) = c/sin(C). Then enter all three sides here.

Can I verify a 3-4-5 triangle is right? Type 3, 4, 5. Angles should come out to about 36.87°, 53.13°, and 90°. Type identifies as “Scalene, Right.” Confirms the textbook answer.

triangle calculator geometry area herons-formula

Related Tools

More in Math & Calculators