Triangle Inequality Calculator
Check whether three lengths can form a triangle, see all three side sums and the type of triangle you get.
What it does
The triangle inequality is the gatekeeper for side lengths. It says that in any triangle the sum of two sides is greater than the third, and the same must hold for every relabelling of the sides. Euclid recorded this as Proposition 20 of Book I of the Elements, and it remains the first check anyone should make before trying to build a triangle from three measured lengths.
Why does the rule hold? The shortest path between two points is a straight line, so going from one vertex to another by way of a third vertex must be longer than going directly. If one length is as big as the sum of the other two, the three points collapse onto a single line and the figure has zero area. That case is called degenerate and it is not a triangle in the usual sense.
In practice you only need one test if you first sort the lengths, because the longest side is the only one that can fail: if the two shorter sides together beat the longest side, the other two inequalities follow automatically. This tool checks all three anyway so you can see exactly which pair fails.
This page takes three positive lengths, runs the three comparisons and reports each one with its numbers. It also gives the smallest margin, which tells you how close the set is to being degenerate, the total perimeter, and the triangle type when one exists.
The lengths can be in any unit as long as all three use the same one. The rule is about relative size, so centimetres, inches or metres all give the same yes or no answer.
How to use
- Enter the first side length.
- Enter the second side length.
- Enter the third side length.
- Use the same unit for all three values.
- Read the verdict at the top of the results.
- Look at the three comparisons and the smallest margin to see how close the set came to failing.
Formula
- a
- First side length, in length units.
- b
- Second side length, in length units.
- c
- Third side length, in length units.
- margin
- Smallest of the three differences, in length units. Positive means a real triangle.
- perimeter
- The sum a + b + c, in length units.
The comparisons are strict. If a sum equals the third side the margin is zero and the points are collinear, so the tool reports that no triangle is possible. An equivalent one-line test is to check that the longest side is shorter than the semiperimeter. Displayed numbers are rounded to two decimal places.
Worked example
Example: sides 7, 10 and 12
A triangle has sides a = 7, b = 10 and c = 12. All three are positive and use the same unit.
- First pair: 7 + 10 = 17, and 17 > 12, so this comparison passes.
- Second pair: 7 + 12 = 19, and 19 > 10, so this passes.
- Third pair: 10 + 12 = 22, and 22 > 7, so this passes.
- Margins: 17 - 12 = 5, 19 - 10 = 9 and 22 - 7 = 15. The smallest is 5.
- With all three tests passing and a positive margin, the lengths form a triangle.
- Perimeter is 7 + 10 + 12 = 29, and no two sides are equal, so the triangle is scalene.
- The tool shows a yes verdict, the three comparisons, smallest margin 5, perimeter 29 and type Scalene.
Reference table
| Sides a, b, c | a + b against c | a + c against b | b + c against a | Forms a triangle? | Type |
|---|---|---|---|---|---|
| 7, 10, 12 | 17 > 12 | 19 > 10 | 22 > 7 | Yes | Scalene |
| 5, 5, 9 | 10 > 9 | 14 > 5 | 14 > 5 | Yes | Isosceles |
| 3, 4, 8 | 7 <= 8 | 11 > 4 | 12 > 3 | No | Not a triangle |
| 2.5, 3.5, 6 | 6 <= 6 | 8.5 > 3.5 | 9.5 > 2.5 | No | Not a triangle |
Limits
- Checks lengths in a flat plane only; the rule changes for triangles drawn on curved surfaces.
- Assumes the three numbers are measured in the same unit.
- Does not construct the triangle or give its angles, only whether one can exist.
- Uses strict inequality, so an exactly degenerate set is reported as no triangle.
Common mistakes
- Checking only the longest side against one of the others instead of the sum of the two shorter sides.
- Treating equality as acceptable, which produces a flat triangle with zero area.
- Mixing units, such as comparing one side in inches with the others in centimetres.
- Assuming a large margin guarantees a large area; a thin triangle can still pass all three tests.
- Forgetting that the labels a, b and c are interchangeable for this test.
Try it yourself
Quick checks. Answers sit tucked under each question.
Can sides 3, 4 and 8 form a triangle?
No. The two shorter sides give 3 + 4 = 7, which is not greater than 8. The smallest margin is -1, so the tool reports no triangle.
Sides 5, 5 and 9: what does the tool report?
5 + 5 = 10 > 9, and the other two sums are 14. All pass. The smallest margin is 1, the perimeter is 19 and the triangle is isosceles.
What happens with sides 2.5, 3.5 and 6?
2.5 + 3.5 = 6 exactly, so the margin is zero and the comparison uses <=. The tool reports no triangle because the points would be collinear.
Questions
What is the triangle inequality?
The rule that the sum of any two side lengths of a triangle must be greater than the third side length.
Do I need to check all three pairs?
If you sort the lengths, checking that the two shortest beat the longest is enough. This tool shows all three so you can see which pair fails.
What is a degenerate triangle?
A set of three collinear points where one length equals the sum of the other two. Its area is zero, so it is not a proper triangle.
What does the margin tell me?
It is the smallest amount by which a two-side sum beats the third side. A small positive margin means the triangle is nearly flat.
Can negative or zero lengths be checked?
No. Side lengths must be positive numbers, and the tool asks for a new value if you enter zero or a negative number.
Does the rule depend on units?
No. Scaling all three lengths by the same factor keeps every inequality true or false in the same way.
Sources
- Wikipedia: Triangle inequality, Euclidean geometry section
- ProofWiki: Sum of Two Sides of Triangle Greater than Third Side