Triangle Calculator
Calculate a triangle's validity, perimeter, semiperimeter, area (via Heron's formula), and side classification (equilateral, isosceles, or scalene) from its three side lengths.
How It's Calculated
Formula
s = \frac{a + b + c}{2}
\text{Area} = \sqrt{s(s-a)(s-b)(s-c)}Three side lengths only form a real triangle if they satisfy the triangle inequality: the sum of any two sides must be strictly greater than the third side. This has to hold for all three pairings — a + b > c, a + c > b, and b + c > a. If any one of those fails, the three lengths can't close into a triangle at all. For example, sides of 1, 2, and 3 fail this test: 1 + 2 = 3, which is not strictly greater than 3 — those three lengths lie flat on a single straight line instead of enclosing any area, so they don't form a valid triangle. Once a set of sides passes the triangle inequality, Heron's formula computes the triangle's area directly from the three side lengths alone — no angles required. It works by first finding the semiperimeter (s), half the perimeter, and then taking the square root of s times each side subtracted from s. This calculator also classifies the triangle by its sides: Equilateral (all three sides equal), Isosceles (exactly two sides equal), or Scalene (all three sides different).
Worked Examples
Classic right triangle: sides 3, 4, 5
- Check the triangle inequality: 3+4>5, 3+5>4, 4+5>3 — all hold, so this is a valid triangle.
- Semiperimeter: s = (3 + 4 + 5) / 2 = 6
- Heron's formula: Area = √(s(s-a)(s-b)(s-c)) = √(6 × 3 × 2 × 1) = √36 = 6
- Perimeter = 3 + 4 + 5 = 12
- Classification: all three sides differ, so this triangle is Scalene.
Equilateral triangle: sides 5, 5, 5
- Check the triangle inequality: 5+5>5 holds for every pairing, so this is a valid triangle.
- Semiperimeter: s = (5 + 5 + 5) / 2 = 7.5
- Heron's formula: Area = √(7.5 × 2.5 × 2.5 × 2.5) = √117.1875 ≈ 10.825
- Perimeter = 5 + 5 + 5 = 15
- Classification: all three sides are equal, so this triangle is Equilateral.
Frequently Asked Questions
What is the triangle inequality, and why does it matter?
The triangle inequality says the sum of any two sides of a triangle must be strictly greater than the third side (a+b>c, a+c>b, and b+c>a all at once). It matters because it's the actual geometric test for whether three lengths can close into a triangle at all — if two shorter sides only just reach, or don't reach, the length of the third side, they can't meet to form a vertex. For example, sides of 1, 2, and 3 fail: 1 + 2 = 3 exactly, so the two shorter sides lie flat along the third instead of meeting above it, producing a degenerate, zero-area line rather than a triangle.
What is Heron's formula useful for?
Heron's formula computes a triangle's area directly from its three side lengths, with no need to know any of its angles or its height. That makes it especially useful when you only have measurements of the sides — for example, from a survey, a construction layout, or a set of GPS distances — and don't have (or don't want to calculate) angle information first.
What's the difference between equilateral, isosceles, and scalene?
These classify a triangle by how many of its sides are equal in length. Equilateral means all three sides are equal. Isosceles means exactly two sides are equal (and the third is different). Scalene means all three sides have different lengths. Classification only applies to a valid triangle — three lengths that fail the triangle inequality aren't a triangle of any kind.
Why does my input show as invalid even though all three numbers are positive?
Positive side lengths are necessary but not sufficient — the three lengths also have to satisfy the triangle inequality (the sum of any two must exceed the third). Three positive numbers like 1, 2, and 10 are each individually valid lengths, but 1 + 2 is nowhere close to exceeding 10, so they cannot form a triangle.
Can a triangle have a side length of exactly 0?
No. A side length of 0 isn't a valid triangle side — it collapses that side to a single point, leaving at most a line segment, not a two-dimensional shape. This calculator requires all three sides to be strictly greater than 0 and reports 0 (or negative) side lengths as invalid input.