Triangle area calculator
Area, perimeter and all three angles from the three sides. It uses Kahan's rearrangement of Heron's formula rather than the version in the textbooks, which is 14% wrong on a thin triangle — and it shows you both numbers so you can see the difference. Nothing you type here leaves your browser — it is worked out on your own device, so there is nothing to send and nothing to log.
The formula in the textbook is wrong
Every book gives the same method for the area of a triangle from its three sides. Take half the perimeter, call it s, then:
area = √s(s−a)(s−b)(s−c)
It is correct algebra and it does not survive contact with a computer. For a thin triangle — one long sliver, which is what a surveyor or a CAD file produces constantly — s and a are almost the same number, and subtracting two almost-equal numbers throws away nearly every significant figure you had. The multiplication then happens on what is left, which is mostly rounding error.
| Sides | 1010, 1010, 10−5 |
|---|---|
| True area | 50,000 |
| Textbook formula | 57,220.46 — 14% out |
Kahan's rearrangement fixes it. Sort the sides so a ≥ b ≥ c, then group the subtractions so the terms that cancel are taken between numbers of similar size:
area = √(a+(b+c))(c−(a−b))(c+(a−b))(a+(b−c)) ÷ 4
Algebraically the same expression. Numerically sound. This page uses it, and shows you what the textbook version would have said.
And here is why nobody notices. A 3-4-5 triangle gives 6 under both formulas. So does 13-14-15, which is the other example every textbook uses. The cases chosen to demonstrate the formula are precisely the cases that cannot tell a correct implementation from a broken one, so the checks behind this page sweep 400 triangles weighted towards slivers and compare against exact rational arithmetic rather than another floating-point sum.
Where to go next
- Distance between two points
- Circle calculator
- Volume calculator
- Right-angled triangle — when you know two sides and the angle is ninety degrees.
- Every tool on the site