How to use the triangle area calculator
- Pick Base and height or Three sides (Heron's formula) in the Method list.
- Fill only the fields for that method. The page starts with a base of 10, a height of 5 and sides 3, 4 and 5.
- For base and height, the height is the perpendicular distance from the base to the opposite vertex, not a slanted side.
- Read the area. The sides method also lists the semi-perimeter s.
Formulas and sources
This triangle area calculator offers two routes. With base b and perpendicular height h: Area = b x h / 2. With sides a, b and c, Heron of Alexandria's formula gives Area = sqrt(s(s - a)(s - b)(s - c)) where s = (a + b + c) / 2. It appears in Heron's Metrica (first century CE).
The code does not evaluate Heron's formula in that raw form for the area. It uses William Kahan's rearrangement: sort the sides so a >= b >= c, then Area = sqrt((a + (b + c))(c - (a - b))(c + (a - b))(a + (b - c))) / 4. It is algebraically identical but avoids the large loss of accuracy that the raw form suffers on very thin triangles.
Worked results
| Input | Output |
|---|---|
| Base 10, height 6 | 30 |
| Base 2.5, height 1.5 | 1.875 |
| Sides 3, 4, 5 | s = 6, area 6 |
| Sides 5, 5, 5 | s = 7.5, area 10.8253175473 |
| Sides 7, 8, 9 | s = 12, area 26.83281573 |
| Sides 1000000, 1000000, 0.001 | s = 1,000,000.0005, area 500 |
The last row is a very thin triangle. Its true area is half of 0.001 times a height of about 999,999.999999875, which is 499.9999999999 and rounds to 500 at 12 significant digits. Raw Heron arithmetic in double precision returned 499.999965541 for this input; the stable form returns 500.
Invalid triangles and limits
- Sides must be positive. A zero or negative side returns an error.
- The triangle inequality must hold strictly. Sides 1, 2 and 3 return "These sides cannot form a valid triangle" because 1 + 2 equals 3, which would be a flat line.
- Base and height may be zero, and the area is then 0. A negative base or height returns an error.
- An empty field returns "Enter both a base and a height." or "Enter all three side lengths."
- Results are rounded to 12 significant digits. Enormous inputs such as three sides of 10300 return "Those side lengths are too large to calculate." because the area would overflow.
Units, scaling and checks
The triangle area calculator is unit-agnostic, but the area is in the square of whatever you enter: centimeters give square centimeters, feet give square feet. Mixed units must be converted first. Doubling every side multiplies the area by 4.
An equilateral triangle with side 1 has area sqrt(3) / 4, which is 0.433013. A gable end 6 m wide and 2.5 m high has an area of 7.5 m2. To turn square feet of plot into acres use acres to square feet. For a 90 degree corner see the right triangle calculator, and for rectangles the rectangle area calculator.
Worked examples
| Example | Input | Result |
|---|---|---|
| Right triangle (base and height) | Method: base-height; Base: 6; Height: 8 | Area: 24 |
| Equilateral triangle (sides) | Method: sides; Side a: 10; Side b: 10; Side c: 10 | Semi-perimeter (s): 15; Area: 43.3012701892 |
| Scalene triangle 3-4-5 | Method: sides; Side a: 3; Side b: 4; Side c: 5 | Semi-perimeter (s): 6; Area: 6 |
| Small decimal triangle | Method: base-height; Base: 2.5; Height: 1.2 | Area: 1.5 |
FAQ
What is the formula for the area of a triangle?
Area = base x height / 2 when the perpendicular height is known. For three sides use Heron's formula with the semi-perimeter s = (a + b + c) / 2.
Does the triangle area calculator work for obtuse and right triangles?
Yes. Both methods hold for every triangle. For an obtuse triangle the perpendicular height falls outside the base, but the formula is unchanged.
Why are my sides rejected?
The sum of any two sides must be strictly greater than the third. Sides 1, 2 and 3 fail because 1 + 2 = 3, and 2, 3 and 10 fail because 2 + 3 is below 10.
Why does a very thin triangle still give the right area?
The tool sorts the sides and uses Kahan's form of Heron's formula, which avoids subtracting nearly equal numbers. Plain Heron gave 499.999965541 for sides 1000000, 1000000 and 0.001, against the correct 500.
Can the height be larger than the base?
Yes. Any non-negative values are allowed, such as base 2 and height 50, which gives area 50.
Do I need to convert units first?
Yes, all inputs must share one unit. The area is in that unit squared.
How do I find the height from the sides?
You do not need it. Choose the sides method. If you want the height anyway, double the area and divide by the base.