Heron's Formula Calculator, Triangle Area & Angles
Calculate triangle area using Heron's formula (SSS), SAS, or base-height. Shows all angles via law of cosines, altitudes, triangle type, SVG diagram, and step-by-step working.
Press Enter to calculate · Esc to reset
What Is the Heron's Formula Calculator, Triangle Area & Angles?
Heron's formula computes the area of any triangle given only its three side lengths, no angles or height required. Named after Hero of Alexandria (c. 60 AD), it is one of the most practically useful formulas in geometry because side lengths are easy to measure with a tape measure.
How Heron's Formula Works
The formula uses the semi-perimeter s = (a+b+c)/2. The area is then √(s(s-a)(s-b)(s-c)). Notice that each factor (s-a), (s-b), (s-c) represents how much the semi-perimeter exceeds each side, if a triangle becomes degenerate (flat), one factor approaches zero and the area approaches zero.
Triangle Inequality
Three lengths form a valid triangle only if each side is strictly less than the sum of the other two: a + b > c, a + c > b, and b + c > a. If any inequality is violated, no triangle can be formed. This calculator checks all three conditions before computing.
Three Calculation Modes
- • SSS (three sides): directly uses Heron’s formula. Also computes all angles via the law of cosines.
- • SAS (side-angle-side): uses Area = ½ ab sin(C), then finds third side c = √(a²+b²-2ab cos C).
- • Base and Height: uses the simple formula Area = ½ × base × height. Assumes an isosceles triangle for the SVG diagram.
Formula
How to Use
- 1Select a mode: Three Sides (SSS), Side-Angle-Side (SAS), or Base and Height.
- 2For SSS mode: use a preset (Equilateral, Right 3-4-5, Scalene 7-8-9, Obtuse 2-3-4) or enter your own values.
- 3For SSS mode: enter all three side lengths a, b, c in any consistent unit (cm, m, inches, etc.).
- 4For SAS mode: enter side a, the included angle C in degrees, and side b.
- 5For Base-Height mode: enter the base length and the perpendicular height.
- 6Press Calculate (or Enter on any input) to compute the result.
- 7Review the SVG diagram of your triangle, scaled to your input proportions with labeled vertices and sides.
- 8Expand Step-by-step working to see the semiperimeter calculation and each substitution into Heron’s formula.
Example Calculation
s = (13+14+15)/2 = 21. Area = √(21 × 8 × 7 × 6) = √7056 = 84.
This is a Heronian triangle, integer sides and integer area. Heights: h from side 14 = 2×84/14 = 12.
s = 6. Area = √(6 × 3 × 2 × 1) = √36 = 6.
Verify: Area = ½ × 3 × 4 = 6. Angle C (opposite side 5) = arccos(0) = 90°.
s = 7.5. Area = √(7.5 × 2.5 × 2.5 × 2.5) = √117.1875 ≈ 10.825.
All angles = 60°. Alternative: Area = (√3/4) × 5² = √3 × 6.25 ≈ 10.825. Verified.
Understanding Heron's Formula, Triangle Area & Angles
This calculator runs entirely in your browser, no data is sent to any server. All triangle computations use IEEE 754 double-precision floating-point arithmetic. Angles are computed using the law of cosines with clamping to prevent domain errors near degenerate triangles.
Applications of Heron's Formula
- • Land surveying: compute land parcel areas from measured boundary distances.
- • Architecture and construction: roof truss and structural member area calculations.
- • Computational geometry: mesh algorithms compute polygon areas by triangulation.
- • Geographic information systems (GIS): GPS coordinate triangles for terrain area.
- • Physics: cross-sectional areas and force decomposition in structural analysis.
Numerical Stability
For near-degenerate triangles (very flat, where one side nearly equals the sum of the other two), standard Heron's formula can lose precision. Kahan's numerically stable form avoids this: Area = ¼ × √((a+(b+c))(c-(a-b))(c+(a-b))(a+(b-c))) where a ≥ b ≥ c.
Frequently Asked Questions
What is Heron's formula and why is it useful?
Heron's formula computes the area of any triangle from its three side lengths alone.
- • No need to know angles or the height, only the three sides
- • Formula: Area = √(s(s-a)(s-b)(s-c)) where s = (a+b+c)/2
- • Works for all valid triangles: acute, right, obtuse, equilateral, isosceles, scalene
It is invaluable in surveying and construction where only distances can be measured directly.
How do I check if three side lengths form a valid triangle?
The triangle inequality requires each side to be strictly less than the sum of the other two.
- • a + b > c
- • a + c > b
- • b + c > a
If any condition fails, no triangle can be formed. Example: sides 1, 2, 5 fail because 1 + 2 = 3 < 5.
What is the semi-perimeter and why does Heron's formula use it?
The semi-perimeter s = (a+b+c)/2 is half the perimeter of the triangle.
- • It appears in the inradius formula: r = Area/s
- • The factors (s-a), (s-b), (s-c) are all positive for a valid triangle
- • Heron’s formula can be derived from the law of cosines by algebraic manipulation
How are the triangle angles calculated?
Once the three sides are known, angles are calculated using the law of cosines:
- • cos A = (b² + c² - a²) / (2bc)
- • A = arccos(...), similarly for B and C
- • Verification: A + B + C = 180° (within floating-point precision)
What is a Heronian triangle?
A Heronian triangle has integer side lengths and integer area.
- • Simplest example: right triangle (3, 4, 5) with area = 6
- • Classic example: (13, 14, 15) with area = 84
- • Infinitely many Heronian triangles exist; finding them is a rich number theory problem
- • All Pythagorean triples generate Heronian triangles (right triangles with integer sides)
How is SAS mode different from SSS mode?
SAS (Side-Angle-Side) uses two sides and the angle between them.
- • Area formula: Area = ½ × a × b × sin(C)
- • Third side found by: c = √(a² + b² - 2ab cos C)
- • Once c is known, SSS mode is used to find all remaining properties
What does the SVG diagram show?
The diagram shows your triangle scaled proportionally to the input side lengths.
- • Vertices are labeled A, B, C
- • Side a is opposite vertex A, b opposite B, c opposite C
- • The triangle fills the diagram area proportionally, very flat triangles will appear flat
- • Color-filled with the brand orange theme using design tokens
Can this calculator handle very large or very small triangles?
Yes, for most practical values. The calculator uses IEEE 754 double precision (about 15 significant digits).
- • Very large sides (e.g. 10⁹ m) may lose precision in the s(s-a)(s-b)(s-c) product
- • Near-degenerate triangles (one angle near 0° or 180°) may show reduced precision
- • For engineering use, verify results with an independent calculation for critical applications