Triangle Area Calculator

This calculator finds the area of any triangle by whichever route your measurements allow: base and perpendicular height, three side lengths through Heron's formula, or two sides with the angle between them. It also returns the perimeter, the semiperimeter and the third side where the input determines it, and it checks the triangle inequality before computing so three lengths that cannot close are reported rather than turned into an imaginary answer. Use any consistent unit — results come back in that unit and its square.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
What you knowChoose the route your measurements support; the other fields are ignored.Three sides (Heron's formula)
Side aFirst side. In SAS mode this is one of the two sides bounding the angle.3
Side bSecond side, in the same unit as side a.4
Side cThird side. Only used when you enter all three sides.5
Included angle CThe angle between sides a and b, in degrees. It must be the angle they enclose, not any other angle.60 °
BaseAny side you choose to call the base.10
Perpendicular heightThe perpendicular distance from the base to the opposite vertex, not the length of another side.6

It returns

  • Area — Square units of whatever linear unit you entered.
  • Perimeter — Available whenever all three sides are known or derivable.
  • Semiperimeter s — Half the perimeter — the quantity Heron's formula is built on.
  • Side c — In SAS mode this is the third side, computed from the law of cosines.

The formula

A=s(sa)(sb)(sc)
A=12absinC

In plain text: A = ½·b·h; Heron: s = (a+b+c)/2, A = √[s(s−a)(s−b)(s−c)]; SAS: A = ½·a·b·sin C

  • AArea of the triangle (units²)
  • a, b, cThe three side lengths (units)
  • sSemiperimeter, (a + b + c) / 2 (units)
  • b, hA chosen base and the perpendicular height to it (units)
  • CThe angle enclosed between sides a and b (degrees)

Heron's formula is evaluated here in Kahan's rearranged form, which avoids the loss of precision that the textbook version suffers on long thin triangles.

Updated Category Plane Shapes: Area & Perimeter Verified against published test cases Reading time 9 min

Three ways in, one area

Every triangle has one area, but which formula gets you there depends on what you were able to measure. On paper you usually have a base and a height. In the field you almost never do — you have three tape measurements between stakes, or two distances and the angle a total station read between them. Each of those is a complete description of the triangle, so each yields the area without needing the others.

Base and height is the definition: a triangle is exactly half the parallelogram built on the same base with the same height, so A = ½bh. The height must be perpendicular to the base and it may fall outside the triangle on an obtuse one, which is why it is so often measured wrongly.

Three sides uses Heron's formula, which needs no angle and no height at all. That makes it the workhorse of land measurement: split any polygon into triangles, tape the sides, and you have the area without ever setting up an instrument.

Two sides and the included angle uses A = ½ab·sin C. This is the natural fit for instrument work and for CNC layout, and it is the formula from which the other two are most easily derived. The law of cosines calculator completes the same triangle's remaining side and angles.

How the three formulas connect

Start with A = ½ab·sin C. Drop a perpendicular from the vertex between sides a and b onto side a. Its length is b·sin C, so the area is ½ × base a × height b·sin C. That single line turns the SAS formula into the base-height formula, and it also shows why the area peaks at C = 90°: sin C is largest there. Two sticks of fixed length hinged at one end enclose the most area when they are perpendicular.

Heron's formula follows from the same identity plus the law of cosines. Substitute cos C = (a² + b² − c²)/(2ab) into sin²C = 1 − cos²C, put that into A = ½ab·sin C, and the algebra collapses to A = √[s(s−a)(s−b)(s−c)] with s the semiperimeter. The formula is over two thousand years old and still the fastest way to get an area from a tape.

The textbook form has a numerical flaw worth knowing about. On a long thin triangle — sides 100, 100 and 0.0001, say — the factors (s−a) and (s−b) are differences of nearly equal numbers, and in floating point they lose most of their significant digits. This calculator uses Kahan's rearrangement, which sorts the sides descending and evaluates ¼√[(a+(b+c))(c−(a−b))(c+(a−b))(a+(b−c))]. It is algebraically identical and numerically stable, and it matters for sliver triangles in survey and mesh work.

The tool also enforces the triangle inequality before it computes: the longest side must be shorter than the other two added together. If it is not, no triangle exists and the product under the root goes negative — a real answer is impossible, and reporting one would be worse than reporting nothing.

Worked example: a 7-8-9 plot, three ways

A triangular plot measures 7 m, 8 m and 9 m on the tape.

  1. Check it closes. Longest side 9 < 7 + 8 = 15. Valid.
  2. Semiperimeter. s = (7 + 8 + 9)/2 = 24/2 = 12 m.
  3. Heron's product. s(s−a)(s−b)(s−c) = 12 × (12−7) × (12−8) × (12−9) = 12 × 5 × 4 × 3 = 720.
  4. Area. A = √720 = 26.8328 m².
  5. Cross-check with SAS. Find the angle opposite the 9 m side: cos C = (7² + 8² − 9²)/(2·7·8) = (49 + 64 − 81)/112 = 32/112 = 0.285714, so C = 73.398° and sin C = 0.958315. Then A = ½ × 7 × 8 × 0.958315 = 28 × 0.958315 = 26.8328 m². Same answer.
  6. Cross-check with base and height. The altitude onto the 9 m side is h = 2A/9 = 53.6656/9 = 5.9628 m, and ½ × 9 × 5.9628 = 26.8328 m².

Notice that each side has its own altitude and the product side × altitude is constant at 2A = 53.6656: onto the 7 m side the altitude is 7.6665 m, onto the 8 m side it is 6.7082 m, onto the 9 m side 5.9628 m. That identity is the quickest way to convert between the three-sides picture and the base-height picture without redrawing anything.

Choosing the method, and what the numbers imply

Pick the method with the smallest measurement error, not the one you remember. Distances taped on the ground are typically good to a few parts per thousand; a perpendicular height paced off a sloping site is far worse, because finding the true foot of the perpendicular by eye is unreliable. That is why Heron dominates field work despite needing more arithmetic.

Angle precision matters most near 0° and 180°, not near 90°. Because area ∝ sin C, the sensitivity dA/dC is proportional to cos C, which is zero at 90°: a one-degree error in a near-right included angle changes the area by only 1 − cos 1° = 0.015%, while the same error at C = 10° changes it by cot 10° × (π/180) = about 10%. If your angle is shallow, measure the third side and switch to Heron instead.

The semiperimeter is worth reading on its own. Each factor (s − a) is positive exactly when side a is shorter than the other two combined, so watching those three factors is the triangle inequality in another form. When one of them approaches zero the triangle is nearly degenerate, the area collapses, and any area computed from measured lengths becomes very sensitive to their errors.

Finally, area and perimeter are not proxies for each other. Among all triangles with a fixed perimeter of 24, the equilateral one (8-8-8) is the largest at 27.7128, the 7-8-9 gives 26.8328, and the near-degenerate 1-11-12 gives zero. Perimeter caps the area but does not determine it.

Areas of common triangles

Every area below is Heron's formula applied to the sides shown, rounded to four decimals.
SidesSemiperimeter sAreaNote
3, 4, 566.0000Right triangle; also ½(3)(4)
5, 12, 131530.0000Right triangle; ½(5)(12)
6, 8, 101224.00003-4-5 scaled by 2, so area ×4
5, 5, 6812.0000Isosceles; height on the 6 side is 4
7, 8, 91226.8328Scalene, √720
10, 10, 101543.3013Equilateral, (√3/4)·100
2, 3, 44.52.9047Obtuse; √8.4375
8, 8, 81227.7128Largest area for perimeter 24

Compare the last two rows against 7-8-9: all three have a perimeter of 24, and the equilateral triangle takes the maximum area.

Mistakes that produce a wrong area

  • Using a side as the height. Only in a right triangle is a leg also an altitude. On any other triangle the perpendicular height is shorter than both adjacent sides.
  • Using the wrong angle in the SAS formula. A = ½ab·sin C needs the angle between a and b. Feeding it a different angle gives a plausible-looking number that is simply wrong.
  • Ignoring the triangle inequality. Sides of 2, 3 and 9 cannot close. Heron's product goes negative and a calculator that takes the root regardless returns nonsense.
  • Halving the perimeter after subtracting. The semiperimeter is half of (a + b + c) computed first; the subtractions come afterwards.
  • Forgetting the obtuse case. On an obtuse triangle the foot of the altitude lies outside the base, so a measured height taken inside the figure is too short.
  • Trusting the textbook Heron form on slivers. Near-collinear triangles lose precision badly in the standard arrangement; use the sorted form this calculator applies.

Related methods and where they take over

When the triangle is right-angled, everything gets simpler: the area is half the product of the legs and no trigonometry is needed. The Pythagorean theorem calculator finds the missing side and the right triangle calculator completes the angles. For the two classroom special cases, use the 30-60-90 triangle calculator and its 45-45-90 counterpart.

When you have coordinates rather than lengths, skip all of this and use the cross-product form, A = ½|x₁(y₂−y₃) + x₂(y₃−y₁) + x₃(y₁−y₂)|, which is the three-point case of the shoelace formula. It is exact, needs no square root, and extends to any polygon.

When you need the altitude itself rather than the area, the triangle height calculator inverts the relationship h = 2A/b. And when the triangle is not fully determined — two sides and a non-included angle, the ambiguous SSA case — you cannot get a unique area from it at all; the law of sines calculator shows both triangles that fit those measurements so you can pick the right one before computing area.

Frequently asked questions

How do I find the area of a triangle with only the three sides?

Use Heron's formula. Add the sides and halve to get s, then take A = √[s(s−a)(s−b)(s−c)]. For 7, 8 and 9: s = 12, the product is 12×5×4×3 = 720, and the area is √720 = 26.8328. No angle or height is needed, which is why surveyors use it.

What is the perpendicular height of a triangle?

It is the shortest distance from a chosen base to the opposite vertex, measured at right angles to that base. It is not the length of another side, and on an obtuse triangle its foot falls outside the base and the height has to be measured to the base's extension. If you know the area, h = 2A ÷ base.

Why does my triangle calculator say the sides are invalid?

Because they break the triangle inequality: the longest side must be shorter than the other two added together. Sides 2, 3 and 9 fail, since 9 > 5. When that happens, Heron's product is negative and no real triangle exists, so no area can be reported.

Which angle does A = &frac12;ab&middot;sin C need?

The angle enclosed between the two sides you entered — the one at the vertex where a and b meet. Any other angle gives a wrong answer. If the angle you have is not the included one, you are in the SSA case and should solve the triangle first with the law of sines.

Is Heron's formula accurate for very thin triangles?

The textbook arrangement is not, because (s−a) and (s−b) become differences of nearly equal numbers and lose precision. This calculator uses Kahan's sorted rearrangement, which is algebraically identical and stable even on near-collinear triangles. For a 100, 100, 0.0001 triangle the difference between the two forms is large.

What is the largest area a triangle with a given perimeter can have?

The equilateral one. With a perimeter of 24, the 8-8-8 triangle gives 27.7128 while the 7-8-9 gives 26.8328 and a near-degenerate 1-11-12 gives essentially zero. The general result is A ≤ P²√3/36, with equality only for the equilateral triangle.

How precisely do I need to measure the angle in SAS mode?

It depends where the angle sits. Because area is proportional to sin C, the sensitivity is proportional to cos C: near 90° an error of one degree shifts the area by only 0.015%, but at 10° the same error shifts it by about 10%. For shallow angles, measure the third side and use Heron instead.

Can I use this for a triangle given by coordinates?

Yes, but there is a better route. Compute the side lengths with the distance formula and enter them as three sides, or use the shoelace formula directly on the coordinates, which avoids square roots entirely and is exact for integer inputs.

References

  • Heron of Alexandria, Metrica, Book I (the earliest surviving statement of the formula) — Public domain
  • Miscalculating Area and Angles of a Needle-like Triangle — W. Kahan, University of California, Berkeley
  • CRC Standard Mathematical Tables and Formulae, 33rd ed. — CRC Press