Triangle Inequality Calculator
Check whether three lengths can form a triangle, or find the range the third side must fall in given two sides. Valid triangles are also classified.
Triangle Inequality Calculator
Background.
Can sticks of 3, 4 and 8 cm be laid out as a triangle? No. Put the 8 down, hinge the 3 and the 4 at its ends, and even swung flat they cover only 7 cm, a centimetre short of meeting. Swap the 8 for a 6 and they meet with room to spare. The rule behind this is the triangle inequality, stated as Book I, Proposition 20 of Euclid's Elements: in any triangle the sum of any two sides is greater than the remaining one.
In practice only one comparison is needed: the two shorter sides against the longest. If you know just two of the sides, the rule becomes a range for the third, which must be longer than their difference and shorter than their sum. For sides of 5 and 7 that means strictly between 2 and 12.
When the lengths pass, the verdict also classifies the triangle as equilateral, isosceles or scalene, and as acute, right-angled or obtuse. A third side landing exactly on one of the limits lines the three corners up with no area between them, and is reported separately as degenerate, since textbooks differ on whether that counts as a triangle.
What is triangle inequality calculator?
The triangle inequality says that three positive lengths a, b and c are the sides of a triangle exactly when a + b > c, b + c > a and a + c > b. Euclid's Book I, Proposition 22 supplies the converse, building a triangle from any three lengths that pass, so the test is complete: passing it guarantees a triangle exists. Geometrically it says a straight line is the shortest route between two corners, shorter than any detour through the third.
How to use this calculator.
- Choose Check if you have three lengths and want a yes or no, or Range if you have two and want the limits for the third.
- Enter the lengths in one unit. Any positive value works; zero and negative lengths are refused.
- In Check mode, enter the third length in side c. Range mode ignores that field.
- Read the verdict, then the two limits and the width of the range beneath it. A third side exactly equal to either limit is reported as degenerate.
The formula.
Fix a and b and solve the three conditions for c. a + b > c gives c < a + b. The other two give c > a − b and c > b − a, and since one of those is negative unless a equals b, together they say c > |a − b|. So the allowed third sides form one open interval, |a − b| < c < a + b, whose width (a + b) − |a − b| works out to twice the smaller of a and b. For the shape, call the longest side L and the other two p and q. The law of cosines, L² = p² + q² − 2pq·cos θ, ties the sign of p² + q² − L² to the angle θ opposite L: positive means acute, zero means a right angle (the converse of Pythagoras, Elements I.48), negative means obtuse (Elements II.12). Only the longest side needs testing, because the largest angle always faces it.
A worked example.
Check 5, 7 and 9. The limits for the third side come from the first two: |5 − 7| = 2 and 5 + 7 = 12, so it must lie strictly between 2 and 12, a range 10 units wide. Since 9 is inside, the lengths form a triangle. All three differ, so it is scalene. For the angles, the longest side is 9: 9² = 81, while 5² + 7² = 25 + 49 = 74. Because 81 exceeds 74, the angle facing the 9 is more than 90° and the triangle is obtuse; the law of cosines puts it at arccos((74 − 81) ÷ 70) = arccos(−0.1), about 95.74°. The verdict reads: yes, scalene and obtuse. Entered as 5, 7 and 12, the same pair gives a degenerate result, and 5, 7 and 13 gives a plain no.
Frequently asked questions.
Do I have to test all three inequalities?
Why is the range always twice the shorter side?
Is a side exactly equal to the sum of the other two allowed?
How can three sides alone tell me whether a triangle is right-angled?
Does the triangle inequality work on a globe?
References& sources.
- [1]Euclid, Elements, Book I, Proposition 20 — 'In any triangle the sum of any two sides is greater than the remaining one.' David E. Joyce web edition of the Heath translation, Clark University; statement confirmed verbatim on retrieval 2026-07-29. Open access.
- [2]Euclid, Elements, Book I, Proposition 22 — 'To construct a triangle out of three straight lines which equal three given straight lines: thus it is necessary that the sum of any two of the straight lines should be greater than the remaining one.' This is the converse, and it is what licenses the calculator to say a valid triple really does close into a triangle. Joyce web edition; confirmed verbatim on retrieval 2026-07-29. Open access.
- [3]Wolfram Research, MathWorld — 'Triangle Inequality' (live revision retrieved 2026-07-29). States the three conditions a + b > c, b + c > a and a + c > b with a, b, c > 0. Used as the independent authority checking this page's bounds: for a = 5 and b = 7 those conditions give exactly 2 < c < 12, both strict — agreement. Open access.
- [4]Euclid, Elements, Book II, Proposition 12 — 'In obtuse-angled triangles the square on the side opposite the obtuse angle is greater than the sum of the squares on the sides containing the obtuse angle by twice the rectangle contained by one of the sides about the obtuse angle…' The classical statement of the obtuse case behind this page's angle classification; the acute case is Book II, Proposition 13 and the right-angle case is Book I, Proposition 48. Joyce web edition; confirmed verbatim on retrieval 2026-07-29. Open access.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- Primary sources
- 4 cited below
- Method
- |a − b| < c < a + b
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled