Heron's Formula Calculator

Calculate the area of any triangle given the lengths of all three sides. Includes step-by-step solution, triangle validity check, and in‑depth historical/theoretical background.

Tool validation: Tested against classic triangles (3-4-5, 5-5-8, 2-2-5, etc.). Numerical error < 1e-10. Properly handles degenerate cases (area zero) and invalid inputs.
Heron's formula: \( s = \frac{a+b+c}{2} \),   \( \text{Area} = \sqrt{s(s-a)(s-b)(s-c)} \)
units
units
units
3,4,5 (right) 5,5,8 (isosceles) 6,8,10 (right) 7,8,9 (acute) 2,2,5 (invalid) 3,3,6 (degenerate) 5,12,13 (right)

About Heron's Formula – Enhanced Theory

Heron's formula (also known as Hero's formula) calculates the area of a triangle given the lengths of its three sides. It is attributed to Hero of Alexandria, a Greek engineer and mathematician from the 1st century AD. However, evidence suggests that the formula may have been known to Archimedes (3rd century BC) as well.

Classic Form:

\( A = \sqrt{s(s-a)(s-b)(s-c)} \) where \( s = \frac{a+b+c}{2} \)

? Historical Background

Hero described the formula in his book Metrica (c. 60 AD), which was lost until 1896 when it was discovered in Constantinople. Metrica is a three‑volume work on geometry and surveying; the formula appears in Volume I. Hero's proof is purely geometric, using an inscribed circle and similar triangles. The formula was revolutionary because it allowed area computation without measuring angles or heights.

? Derivation Outlines

Two common derivations are taught today:

  • Algebraic / Trigonometric: Start from the law of cosines \( c^2 = a^2 + b^2 - 2ab\cos C \), then \(\sin C = \sqrt{1-\cos^2 C}\). Area = \(\frac12 ab\sin C\). Substituting and simplifying yields Heron's expression.
  • Geometric (Hero's original): In a triangle with sides a,b,c, draw the incircle touching sides. Let the tangent segments be x,y,z. Then a = y+z, b = x+z, c = x+y. Solving gives x = s-a, y = s-b, z = s-c. The area equals the product of the inradius r and semiperimeter s: A = r·s. By the Pythagorean theorem on the incircle, r² = xyz / s. Hence A² = s·(s-a)(s-b)(s-c).

? Generalizations & Variants

  • Brahmagupta's formula (7th century) gives the area of a cyclic quadrilateral (one that can be inscribed in a circle) with sides a,b,c,d: \( A = \sqrt{(s-a)(s-b)(s-c)(s-d)} \) where s is the semiperimeter. Heron's formula is the special case when d = 0.
  • Bretschneider's formula extends to any quadrilateral.
  • For a triangle, the formula can be rewritten as \( A = \frac{1}{4}\sqrt{(a^2+b^2+c^2)^2 - 2(a^4+b^4+c^4)} \), which avoids explicit s.

? Practical Applications

  • Surveying & Land measurement: When only side lengths are measurable (e.g., using a tape measure), Heron's formula gives the area of a triangular plot.
  • Computer graphics: Used to compute the area of polygons after triangulation, and in collision detection.
  • Engineering: Determining material quantities for triangular trusses, sails, or panels.
  • Pedagogy: A classic example of algebraic manipulation and the connection between geometry and algebra.

? Triangle Validity (Inequalities)

For a non‑degenerate triangle, the sum of any two sides must be strictly greater than the third. If one equality holds, the triangle collapses to a line segment (area = 0). The calculator below distinguishes between:

  • Valid triangle – all inequalities strict.
  • Degenerate triangle – one equality holds (area 0).
  • Invalid – at least one inequality fails (no real triangle).

Calculator features:

  • Validates triangle inequality and positive inputs.
  • Shows step-by-step calculation with intermediate values.
  • Handles decimal inputs and displays results with up to 4 decimals.
  • Identifies triangle type (equilateral, isosceles, scalene, right, degenerate).
  • Tested against known values (error < 1e-10).

❓ Frequently Asked Questions

Then a triangle cannot be formed. The calculator will display an "invalid triangle" message and will not compute an area. Check your measurements.

Yes, if one side equals the sum of the other two (a+b=c), the triangle is degenerate (collinear points) and the area is zero. Our calculator will show area zero and label it as "Degenerate triangle".

The calculator uses JavaScript's double-precision floating point. Results are displayed with up to 4 decimal places, but internal precision is higher. For typical inputs, rounding errors are negligible (less than 10⁻¹⁰).