Triangle Area and Perimeter Calculator
Knowing the 3 sides of a triangle is enough to work out its area, with no angle or height to measure: that's what Heron's formula provides. The perimeter follows directly, by simple addition.
Enter the 3 side lengths: the calculator checks they actually form a triangle, then gives the area, the perimeter, and all 3 corresponding heights.
The triangle's 3 sides
Terms marked with an asterisk are defined in the glossary at the foot of the page.
How three sides give the area: Heron's formula
Three side lengths, and nothing else, already determine the area of a triangle. That is the point of Heron's formula*. Write s for the semi-perimeter*, half the sum of the sides. The area is then the square root of a four-factor product.
A geometric argument splits the triangle into three smaller ones that share the incircle. Each has area ½·side·r, so the whole area is r·s. The two tangent segments from each vertex are equal; call them x, y, z. Then a = y + z and s − a = x, and likewise around the figure. A short extra identity, r² = (s − a)(s − b)(s − c) / s, turns r·s into the square root above.
There is an algebraic route as well, via ½bc sin A and the cosine rule. Same destination. This page takes the algebraic path after it has checked that a, b and c close. No incircle is drawn here — that lives on the incircle and circumcircle calculator.
The triangle inequality, and the lengths that never close
Try 2, 3 and 10. The two short sides, laid end to end, only reach 5. They never meet the ends of the long one. Each side must be strictly shorter than the sum of the other two.
a + b > c · b + c > a · c + a > b
Equality is the degenerate case: three collinear points, area zero, not a triangle. Heron would return √0. If a side is genuinely too long, the product s(s−a)(s−b)(s−c) goes negative and there is no real square root. That is the triangle inequality* doing its job, not a software quirk.
The form tests all three inequalities before doing anything else. Fail one, and the calculation stops. The length unit on the form is a label only: 5, 6 and 7 stay 5, 6 and 7; the results come back in that same unit, squared for the area. Switching the dropdown from centimetres to metres does not convert a previous entry.
When base × height is the shorter route
If a perpendicular height is already known, stop. Half base times height is one multiplication. A rectangular plot with a tape and a set-square is that job, and there is no reason to reach for four factors and a root.
Heron is for the other job: three taped sides, no convenient altitude. Dropping a perpendicular across a ditch just to feed the school formula is wasted work. Compute s, take the root, done.
They are not rivals. Once Heron has the area, each height is 2·area divided by the opposite side — which is what the results table lists. Going the other way, a known height makes Heron a waste of keystrokes.
A base in metres and a height in centimetres will not give square metres. Convert first, then multiply. The unit selector here does not do that conversion; it only names the unit already used for the three sides.
Two sides and the included angle (SAS)
Two sides and the angle sitting between them: that is SAS*, and the third side is not needed.
A = ½ · a · b · sin C
C has to be the included angle. Swap in a different corner and the number is wrong. At 90° the sine is 1, so a right triangle collapses to ½ab. At 60° the equilateral case comes back with a little √3.
Theodolites love this form. Two measured lengths, one observed angle, an area on the spot. This calculator never asks for an angle. If that is what is to hand, either apply ½ab sin C directly or recover the third side from the cosine rule and come back. Degrees and radians are not interchangeable inputs — the triangle solver keeps them apart, and will also finish an SSS* case that this page leaves as area only.
Right-angled, isosceles and equilateral shortcuts
Three shapes keep turning up. Each has a shortcut that Heron will rediscover — and that is faster by hand.
- Right-angled. Area is half the product of the legs. The altitude to the hypotenuse is 2A divided by that hypotenuse.
- Isosceles. The altitude from the apex hits the base at its midpoint. Pythagoras gives the height; then A = (base × height) / 2.
- Equilateral with side a: A = (√3 / 4) a², perimeter 3a, height (√3 / 2) a. Feed s = 3a/2 into Heron and the same (√3 / 4) a² drops out.
A scalene triangle has none of those gifts. That is Heron's home ground. An equilateral triangle is also a regular 3-gon, so the two calculators meet there.
From three sides to the three angles: the cosine rule
SSS — three sides — determines the angles uniquely, up to ordering. The cosine rule* does the work:
cos A = (b² + c² − a²) / (2bc)
Then A = arccos(…). Repeat for B and C. They must add to 180°. A total of 179.8° or 180.2° is rounding, not a broken triangle. A negative cosine means an obtuse angle; Heron does not care, the area stays positive, and the diagram on this page opens that vertex past 90°.
This page does not print the angles. Area is the brief. Nothing stops a side calculation of the angles once a, b and c are known; the dedicated solver is the cleaner route when every element is wanted. Three vertices as coordinates, rather than three lengths, belong on the distance between two points page first, then here or on the incircle page.
Worked numbers: a 5-6-7 triangle
Those are the form defaults. Perimeter 18, so s = 9.
A = √[9 × (9 − 5) × (9 − 6) × (9 − 7)] = √(9 × 4 × 3 × 2) = √216 = 6√6 ≈ 14.697
Heights: ha = 2A/5 ≈ 5.879, hb ≈ 4.899, hc ≈ 4.199. Any height times its side, halved, returns 14.697. Same area, three cuttings.
Angles, if wanted. Cos C = (25 + 36 − 49) / 60 = 0.2, so C ≈ 78.46°. Cos A = 5/7, A ≈ 44.42°. B fills out 180°, about 57.12°. None of them is 90°. A 5-6-7 is not a scaled 3-4-5.
Skinny triangles and floating-point Heron
Four factors, then a square root. If the triangle is needle-thin, one of (s − a), (s − b), (s − c) is tiny. Subtract two nearly equal lengths and a cheap calculator eats the significant digits. The area can come out a little off, or even imaginary from a rounding blip below zero.
For a decent 5-6-7 that never shows. For sides 100, 100 and 0.01, it might. One numerically stabler rewrite is to sort a ≥ b ≥ c and use a rearranged product; another is to go via ½ab sin C with a cosine computed carefully. This page works in ordinary floating point, which is plenty for survey lengths actually taped.
Keep one unit for all three sides. Mix metres with centimetres and the inequality check will either reject a good triangle or swallow a bad one. After all, 5 m, 6 m and 700 cm look like a 5-6-7 until they are written in the same unit — and then they are a 5-6-7 still, but only if the conversion actually happens.
Integer triples and the 3-4-5 set-out
Pythagoras talks about sides, not area. The two identities are tangled even so. Take a 3-4-5: s = 6, Heron gives √[6·3·2·1] = 6, and ½·3·4 is also 6. In any right triangle the four factors s, s−a, s−b, s−c collapse, via a² + b² = c², into (ab/2)². Heron secretly contains Pythagoras.
A knotted cord of 12 units (3 + 4 + 5), pulled tight, is a field right angle. Multiples 6-8-10 and 9-12-15 do the same job at larger scale. Entered as 3, 4 and 5, the area must come out as 6, the heights as 4, 3 and 2.4. That 2.4 is 2·6 / 5, the altitude to the hypotenuse; it also equals the product of the legs over the hypotenuse, (3·4)/5 = 2.4.
A near-right test follows the same numbers. If a² + b² sits close to c², the angle is close to 90°, and ½ab will sit close to Heron's value. The gap says how far the corner has drifted — useful on a slope or a wall that is supposed to be square, before anyone bothers with a theodolite.
Area and semi-perimeter already give the inradius
Area and semi-perimeter already give the inradius: r = A / s. For 5-6-7 that is about 14.697 / 9 ≈ 1.633. For 3-4-5, r = 1 exactly.
r = A / s · R = abc / (4A)
The circumradius is R = abc / (4A). On 3-4-5, R = 60 / 24 = 2.5, half the hypotenuse — the right-triangle rule. Centres, though, need a coordinate frame. Three lengths give r and R; they do not place I and O on a drawing. That is why the sister page asks for vertices, not sides. The rest of the plane-geometry family — rectangles, rhombi, trapezoids, regular polygons, circles — sits in the same category.
Glossary
- Heron's formula
- The identity that gives a triangle's area from its three side lengths alone: A = √[s(s − a)(s − b)(s − c)], with s the semi-perimeter. Named after Heron of Alexandria.
- Semi-perimeter (s)
- Half the perimeter: s = (a + b + c) / 2. It is the quantity that appears in Heron's formula and in the inradius r = A / s.
- Triangle inequality
- The condition that each side is strictly shorter than the sum of the other two. If it fails, the three lengths do not close, and there is no triangle to measure.
- SSS
- Side–side–side: the case in which all three sides are known. The shape is then unique (up to reflection), and the angles follow from the cosine rule.
- SAS
- Side–angle–side: two sides and the angle included between them. Area is then ½ab sin C, with no need for the third side.
- Cosine rule
- The identity c² = a² + b² − 2ab cos C, or rearranged as cos C = (a² + b² − c²) / (2ab). It recovers an angle from three sides, and a side from two sides and the included angle.