Glossary
Heron's formula
Triangle area from three sides
By Buğra SözeriPublished Updated
Heron’s formula computes the area of a triangle from its three side lengths, without needing the height. Named for Hero of Alexandria, the 1st-century mathematician who published it in his Metrica.
Given side lengths a, b, c, define the semi-perimeter s = (a + b + c) / 2. Then:
A = √(s(s−a)(s−b)(s−c))
The formula is elegant because it uses only the side lengths — no angles, no height. When all you have is three measurements of a triangular plot, three sides of a sail, or three edges of a tile, Heron’s formula is the most direct path to the area.
Edge case: if the three values don’t satisfy the triangle inequality (any side ≥ sum of the other two), the quantity under the square root is negative and the formula returns no real solution. Our area calculator surfaces this as a zero result rather than NaN.
Worked example: for a triangular plot with sides 13 m, 14 m, and 15 m, the semi-perimeter is s = (13 + 14 + 15)/2 = 21. Then s − a = 8, s − b = 7, s − c = 6. The area is √(21 · 8 · 7 · 6) = √7056 = 84 m². The classical 3-4-5 right triangle illustrates the link to the more familiar formula: s = 6, area by Heron is √(6 · 3 · 2 · 1) = √36 = 6, which matches ½ · 3 · 4 = 6 from the right-angle case. For an equilateral triangle of side a, Heron collapses to A = (√3 / 4)·a².
Numerical-stability variant for skinny triangles: when one side is much longer than the others (a “needle” triangle), the textbook Heron formula can lose precision catastrophically because s − a is the difference of nearly-equal numbers. William Kahan’s 1986 reformulation sorts the sides as a ≥ b ≥ c and computes A = ¼·√((a + (b + c))·(c − (a − b))·(c + (a − b))·(a + (b − c))), which is numerically stable to within a few ULP even for triangles where the standard form returns negative-discriminant errors. The Bretschneider formula generalises Heron to arbitrary quadrilaterals, and Brahmagupta’s formula does the same for cyclic quadrilaterals. Related: area calculator, math methodology.
Derivation in one paragraph. Drop an altitude from one vertex to the opposite side; the triangle splits into two right triangles whose hypotenuses are the original sides. Apply the Pythagorean theorem twice and eliminate the altitude algebraically. The resulting expression in a, b, c factors symmetrically into s(s−a)(s−b)(s−c) — a small miracle of algebra that hides the trigonometry. Hero’s original proof in Metrica was geometric and considerably more intricate; the algebraic derivation we use today dates to the 17th century, but the result has been independently rediscovered everywhere from medieval Chinese mathematics (the Qin Jiushao formula, 1247) to modern computational geometry.
When not to use Heron’s formula. If you already have a base and a height, A = ½·b·h is faster and has no square root. If you have two sides and the included angle, A = ½·a·b·sin(C) avoids the semi-perimeter detour entirely and is more numerically stable for obtuse triangles. If you have coordinates for the three vertices, the shoelace formula A = ½·|x₁(y₂ − y₃) + x₂(y₃ − y₁) + x₃(y₁ − y₂)| avoids the square root, handles degenerate (zero-area) triangles gracefully by returning zero, and generalises to arbitrary polygons. Heron’s formula is the right pick only when sides are the input you actually have.
Real-world uses. Heron’s formula is the working tool for land surveying when access to the interior of the plot is restricted — you can pace off the three side lengths along the boundary and compute the enclosed area without ever stepping inside. Sailmakers use it to compute the surface area of triangular sails from edge measurements. Computer graphics pipelines use Heron’s formula (or the shoelace variant) to compute mesh triangle areas for shading and texture-density calculations. Estimators in the construction trades use it for triangular sections of gable roofs, dormers, and irregular flooring patterns where measuring the height directly would require a ladder.
Frequently asked questions
- What is Heron's formula?
- Heron's formula calculates the area of a triangle from its three side lengths alone: A = √(s(s−a)(s−b)(s−c)), where s is the semi-perimeter (a+b+c)/2.
- How do I use Heron's formula in practice?
- Add all three sides, halve the result to get s, then compute √(s(s−a)(s−b)(s−c)). For example, a triangle with sides 3, 4, 5 has s = 6, so A = √(6×3×2×1) = √36 = 6 square units.
- When is Heron's formula better than the base-times-height method?
- When you know all three side lengths but not the height — such as in surveying, GPS coordinate triangles, or CAD calculations — Heron's formula avoids computing altitude entirely.
- Does Heron's formula work for obtuse or equilateral triangles?
- Yes, it works for any valid triangle regardless of angle type. The formula returns a positive area as long as the three sides satisfy the triangle inequality.
Related
Published May 14, 2026 · Last reviewed May 31, 2026