Skip to content
Contania

Triangle Calculator

Enter the three side lengths of a triangle to find its perimeter and area, and to classify it by its sides and by its angles. The sides must satisfy the triangle inequality.

Your numbers

Result

Area
6
square units
Perimeter
12
By sides
Scalene
By angles
Right triangle
Triangle
ItemValue
Sides3, 4, 5
Perimeter12
Area (Heron)6
By sidesscalene
By anglesright

Area from three sides: Heron's formula

The familiar area formula, ½ × base × height, needs a height — and a height is not something you can measure from the three sides alone without extra work. Heron's formula removes that step entirely. Take s, the semiperimeter, which is half of a + b + c. Then area = √[s × (s − a) × (s − b) × (s − c)]. For sides 3, 4 and 5: the perimeter is 12, so s = 6, and the area is √(6 × 3 × 2 × 1) = √36 = 6. The formula is worth appreciating for what it does not require. No angle, no height, no orientation, no coordinate system — just three lengths, which are usually the only things you can actually measure on a physical object. That is why it turns up in surveying and land measurement far more often than in classrooms. The structure also encodes a warning. If any one side is longer than the other two combined, one of the bracketed terms goes negative, the product goes negative, and the square root has no real value. The formula fails exactly when the triangle does not exist.

The triangle inequality

Not every three lengths make a triangle. The condition is the triangle inequality: each side must be shorter than the sum of the other two, and all three comparisons have to hold. With 3, 4 and 5 they do — 5 is less than 7, 4 is less than 8, 3 is less than 9 — so the triangle closes. With 2, 3 and 9 they do not: the short sides total 5, and 5 cannot reach across a gap of 9. Laid end to end, they simply fall short. The calculator refuses to return an area and says so, rather than reporting a meaningless zero. The boundary case is worth naming. If one side exactly equals the sum of the other two — 3, 4 and 7 — the three points are collinear. That is a degenerate triangle: a flat line with zero area. Heron's formula gives exactly 0, which is the honest answer. In practice, this check is often the point. Measure three distances in the field, feed them in, and if they violate the inequality then one of the measurements is wrong.

Classifying by sides and by angles

Every triangle gets two independent labels, and this page returns both. By sides. All three equal is equilateral; exactly two equal is isosceles; all three different is scalene. Equal sides always sit opposite equal angles, so an equilateral triangle also has three 60° angles, and an isosceles triangle has two equal ones. By angles, and here is the useful part: you do not need to measure a single angle. Square the longest side and compare it with the sum of the squares of the other two. If they are equal, c² = a² + b², the triangle is right. That is the converse of the Pythagorean theorem, and 3-4-5 satisfies it exactly — 25 = 9 + 16. If c² is smaller, every angle is under 90° and the triangle is acute. If c² is larger, one angle exceeds 90° and it is obtuse. There can only ever be one such angle, because the three must total 180°. The two labels combine freely, with one exception: an equilateral triangle is always acute, since 60° is the only angle it has.

Why three sides settle everything

Three side lengths determine a triangle completely — its angles, its area, its shape, everything. This is the side-side-side congruence rule, and it has a physical consequence: a triangular frame cannot be deformed without changing the length of a member. That rigidity is why triangles appear in roof trusses, bridges, bicycle frames and geodesic domes, while a four-bar rectangle folds flat unless you brace it diagonally — which is to say, unless you turn it into two triangles. Three angles do not settle anything. They fix the shape but not the size, since scaling a triangle leaves every angle unchanged. Two triangles with matching angles are *similar*, not congruent, and that is the basis of every scale drawing and shadow-length measurement. A few consequences fall out for free. The interior angles always sum to 180°, so knowing two gives you the third. The largest angle is always opposite the longest side, and the smallest opposite the shortest — which means the ordering of the sides you type in already tells you the ordering of the angles. If you do want the angles themselves, the law of cosines recovers them from the three sides: cos C = (a² + b² − c²) ÷ (2ab).

Precision and thin triangles

Heron's formula is exact in arithmetic but delicate in floating point, and it is worth knowing when to distrust a result. The problem case is the needle: a triangle so thin that one side is nearly equal to the sum of the other two — say 100, 100 and 0.0001. Then s − a and s − b are tiny differences between large, nearly identical numbers, and most of the significant digits cancel before the multiplication even starts. The relative error in the answer can be far larger than the error in the inputs. Numerical libraries handle this with a rearranged version of the formula that sorts the sides longest-first and groups the terms so that no catastrophic cancellation occurs. It is algebraically identical and numerically much better behaved. For ordinary shapes — anything remotely close to equilateral — the plain formula is entirely fine, and results here are rounded to six decimal places. One last practical note: the area comes out in square units of whatever you typed in. Sides in metres give square metres, sides in inches give square inches. The calculator has no idea which unit you used, so consistency across the three inputs is on you.

Frequently asked questions

Sources

Embed this calculator

Copy the code and paste it into your site or blog. Credit with a link back to Contania is included, and the height adjusts itself.

<iframe src="https://contania.app/embed/math/triangle" title="Triangle Calculator — area, perimeter and type" width="100%" height="720" loading="lazy" style="border:1px solid #e5e0d8;border-radius:12px;max-width:640px"></iframe>
<script>window.addEventListener("message",function(e){if(e.data&&e.data.type==="contania:embed-height"){var f=document.querySelector('iframe[src="https://contania.app/embed/math/triangle"]');if(f){f.style.height=e.data.height+"px"}}});</script>

Related calculators

Math

Pythagorean

Find the hypotenuse or a missing leg of a right triangle with the Pythagorean theorem, a² + b² = c². Enter the two known sides.

Calculate
Math

Area

Calculate the area of a rectangle, square, triangle, circle or trapezoid. Pick the shape and enter its measurements to get the area and the formula used.

Calculate
Math

Square Root

Find the square root of any number, plus the cube root and the square. See whether the number is a perfect square.

Calculate
Math

Volume

Calculate the volume of a cube, box, sphere, cylinder, cone or pyramid. Pick the solid and enter its measurements to get the volume and the formula used.

Calculate
Math

Average

Calculate the mean, median, mode and range of a list of numbers, plus the sum and count. Enter your values separated by commas.

Calculate
Math

Combinations

Calculate combinations (nCr) and permutations (nPr). Enter n and r to find how many ways to choose or arrange items — order matters for permutations, not for combinations.

Calculate