Check that the side lengths can form a triangle
Heron’s formula uses s = (a + b + c)/2 followed by A = √[s(s − a)(s − b)(s − c)]. The values a, b, and c are the three side lengths, s is their semiperimeter, and A is the area. All three sides must use one length unit; the calculated area then uses the corresponding square unit.
Before calculating, verify that each pair of sides adds to more than the remaining side. A = 3, B = 4, and C = 8 cannot form a triangle because 3 + 4 is less than 8. A degenerate equality such as 3 + 4 = 7 has zero area and no interior. The runtime rejects nonpositive sides and any set failing one of the three strict inequalities.
The semiperimeter is half the perimeter, not a fourth side or a measurement of the altitude. It makes the four factors inside the root positive for a valid triangle. The formula returns a nonnegative area regardless of how the side labels are assigned, provided they are the three sides of the same triangle.
Worked examples
A 5–6–7 triangle
Inputs: a = 5 units; b = 6 units; c = 7 units.
Calculation: s = (5 + 6 + 7)/2 = 9; A = √(9 × 4 × 3 × 2) = √216 ≈ 14.6969 square units.
The area is approximately 14.697 square units.
A 13–14–15 triangle
Inputs: a = 13 units; b = 14 units; c = 15 units.
Calculation: s = 21; A = √(21 × 8 × 7 × 6) = √7,056 = 84 square units.
The area is exactly 84 square units before display rounding.
Worked examples from side measurements
For sides 5, 6, and 7, s is 9. The factors beneath the root are 9, 4, 3, and 2; their product is 216, whose square root is approximately 14.697. These lengths could be centimetres, metres, or another common unit, so the answer would then be the matching square unit.
The second example uses 13, 14, and 15. Its semiperimeter is 21, and the four factors multiply to 21 × 8 × 7 × 6 = 7,056. The square root is exactly 84, giving a useful integer-area check with a different scale and side pattern.
If you can independently measure an altitude, compare the result with A = bh/2. For the 5–6–7 triangle, taking side 7 as the base gives a corresponding altitude 2A/7, about 4.199 units. This is a derived perpendicular distance, not one of the original side lengths.
When side-only area is convenient
Heron’s formula is useful when three edge lengths are available from a specification, survey, or parts list, but no height is stated. It avoids constructing an altitude on a sketch and works for acute, right, or obtuse triangles. The triangle’s orientation on a page does not affect its area.
The formula is also a cross-check for other representations. The same triangle can be evaluated from two sides and their included angle, or from coordinates if its vertices are known. Agreement among independently calculated results is a strong arithmetic check, as long as all measurements describe the same triangle and the units are aligned.
The area has a useful scaling property. Multiplying all three sides by a common factor k multiplies s and each difference term by k, so the product under the radical is multiplied by k to the fourth power. Its square root therefore scales by k squared, as an area should. Doubling every side makes the area four times as large.
Interpret the output and avoid unstable inputs
The result describes the two-dimensional area enclosed by the three straight sides. It does not supply a perimeter, a height, or a material volume. If you need a perpendicular altitude for a chosen base, derive h = 2A/b using that same base length, or use an instrument designed for that output.
A nearly degenerate triangle has one side close to the sum of the other two. Its area approaches zero, and small measurement errors can create a large relative change in the remaining height or area. Check the triangle inequality against measurement uncertainty, not only against the typed decimal values, before treating a near-zero area as meaningful.
Rounding each side before the calculation can shift the final result, especially when the triangle is very flat. Keep the supplied measurement precision in a working record and round the displayed area only at the end. More decimal places in a calculator cannot restore information lost in the original measurement.
A reliable manual check
A repeatable check is to calculate s, write all four factors explicitly, and inspect their signs before multiplying. For a valid nondegenerate triangle, s is larger than each side, so s − a, s − b, and s − c are positive. A negative factor usually signals a transcription error or invalid geometry, not a negative area.
Compare the perimeter a + b + c with the supplied source and verify that every side belongs to the same triangle. Do not mix a side from an outer boundary with a side from an inner opening. If units differ, convert them before forming s; otherwise the addition itself is dimensionally invalid.