Not every set of three lengths closes into a triangle. Try 4 cm, 7 cm and 12 cm sticks: however you arrange them, the two short ones together fall short of the long one. The rule behind this is the triangle inequality — the sum of any two sides of a triangle is greater than the third side. Euclid proved it as Proposition 20 of Book I of the Elements, and it is the first thing to check before applying any triangle formula.
This calculator has two modes:
- Three sides. It tells you whether the lengths form a real triangle, a degenerate (flat) one where the two short sides add up exactly to the long one, or no triangle at all. For a real triangle it adds the type by angles (acute, right, obtuse) and by sides (scalene, isosceles, equilateral), the perimeter and the area.
- Two sides. It gives the open interval in which the third side must lie, , plus the two lengths that would make a right triangle — the borders between the acute and obtuse cases.
Lengths can be in any unit. Once you know the sides work, the law of cosines calculator gives every angle and the triangle area calculator offers other area formulas.
How to use this calculator
- Choose Three sides to test a set of lengths, or Two sides to find what the third side can be.
- Enter the lengths, in the same unit or with each field’s own unit switch.
- In three-side mode, read the verdict first. The margin shows by how much the two shorter sides beat (or miss) the longest. A real triangle also gets its type, perimeter and area.
- In two-side mode, read the lower and upper bounds. Both are strict: a third side equal to either bound gives a flat triangle. The two right-triangle lengths split the interval into obtuse, acute and obtuse zones.
The formula
For sides , , of a triangle, all three inequalities must hold:
It is enough to test the two shortest sides against the longest: if , the triangle exists exactly when . When the three vertices lie on one line: the triangle is degenerate, with zero area.
Range of the third side. Combining the inequalities for known sides and :
Type by angles. With the longest side, compare with (converse of Pythagoras and the law of cosines): equal → right, greater → obtuse, smaller → acute. In two-side mode, the right-angle lengths are (hypotenuse) and (leg).
The area of a valid triangle comes from Heron’s formula , with the half-perimeter.
Worked example
A shelf bracket that does not close. A carpenter has strips of 4, 7 and 12 cm. The two shorter ones total cm, less than 12 cm: no triangle, with a gap of 1 cm.
A right triangle. Sides 6, 8 and 10: , so the triangle exists, and , so it is right-angled. Its area is 24 square units.
The third side. Two sides measure 9 m and 14 m. The third must satisfy , that is between 5 m and 23 m, both excluded. It forms a right triangle at m (as a leg) or m (as the hypotenuse). Between 10.72 and 16.64 m the triangle is acute; from 5 to 10.72 m and from 16.64 to 23 m it is obtuse.
Why the shortest path is a straight line
The triangle inequality is the geometric form of a familiar fact: going from one point to another directly is never longer than going via a third point. Walking from to through costs , which is at least , and equal only when lies on the segment — the degenerate case.
The same idea reaches far beyond triangles: it defines what a distance is in mathematics (metric spaces), it bounds absolute values (), and it powers error estimates in physics and engineering.
Quick reference
| Sides | Two shortest vs longest | Result |
|---|---|---|
| 3, 4, 5 | 7 > 5 | right triangle |
| 5, 5, 5 | 10 > 5 | equilateral (acute) |
| 2, 3, 4 | 5 > 4 | obtuse () |
| 2, 3, 5 | 5 = 5 | degenerate (flat) |
| 1, 2, 4 | 3 < 4 | no triangle |
Frequently asked questions
How do I know if three side lengths make a triangle?
Sort them, then check that the two shortest add up to more than the longest. If they do, the triangle exists; if the sum is equal, it is flat; if smaller, the sides cannot meet.
What is the range for the third side of a triangle?
It must be greater than the difference of the other two sides and less than their sum: |a − b| < c < a + b. With sides 9 and 14, the third side lies strictly between 5 and 23.
What is a degenerate triangle?
A “triangle” whose two shorter sides add up exactly to the longest, such as 2, 3 and 5. Its vertices are collinear, its area is zero, and its angles are 0°, 0° and 180°. Most problems exclude it, so the inequality is strict.
Do I have to check all three inequalities?
No. If the two shortest sides beat the longest, the other two inequalities hold automatically, since the longest side plus any other side is already larger than the remaining one.
Can the triangle inequality tell whether a triangle is right or obtuse?
Not on its own, but a close relative can: compare the square of the longest side with the sum of the squares of the other two. Equal means right, greater means obtuse, smaller means acute. The calculator shows both checks.
Sources
- Euclid, Elements, Book I, Proposition 20 (D. E. Joyce, Clark University)
- OpenStax, Precalculus 2e, §8.2 Non-right Triangles: Law of Cosines (Heron’s formula)
- Weisstein, E. W., “Triangle Inequality”, MathWorld (Wolfram Research)
Last updated: