Triangle Inequality Calculator
Check whether three lengths can form a triangle, or find the range the third side must fall in. Also classifies it as acute, right or obtuse.
Triangle Inequality Calculator
Background.
The Quanta triangle inequality calculator answers two questions. Give it three lengths and it tells you whether they can be the sides of a triangle, and if they can, whether that triangle is acute, right-angled or obtuse and whether it is equilateral, isosceles or scalene. Give it only two lengths and it tells you the range the third side has to fall in. With the default 5, 7 and 9, the answer is yes: a scalene, obtuse triangle, and the third side had to be strictly between 2 and 12.
The rule is Euclid's, from Book I, Proposition 20 of the Elements: "In any triangle the sum of any two sides is greater than the remaining one." That gives three conditions — a + b > c, b + c > a and a + c > b — but if you fix two sides and treat the third as unknown, the three collapse into a single open interval: the third side must be greater than the difference of the other two and less than their sum. The window is always exactly twice the shorter known side wide, which is why lengthening the longer side never gives the third side more freedom.
Both ends of that interval are excluded, and the calculator says so in its own words rather than rounding the case away. A third side exactly equal to a + b puts the two shorter sides end to end along the longest one; a third side exactly equal to |a − b| lays the short side flat along the long one. Either way the three corners are collinear, the enclosed area is zero, and Euclid's strict "greater than" excludes it. Textbooks split on whether to call that a degenerate triangle or no triangle at all, so this page reports it as its own third outcome — degenerate — and lets you decide which convention your course uses.
Two scope limits worth knowing before you read the answer. First, this is plane geometry: the inequality survives on a sphere for great-circle arcs, but the acute/right/obtuse classification does not, because spherical triangles can have three right angles. Second, this page tests validity and classifies the result; it does not solve the triangle. Once you know your three lengths work, Quanta's triangle solver takes the same three numbers and returns all three angles, the area and the perimeter.
What is triangle inequality calculator?
The triangle inequality theorem states that in any triangle, the sum of the lengths of any two sides is strictly greater than the length of the remaining side. Euclid proved it as Book I, Proposition 20 of the Elements, and Book I, Proposition 22 supplies the converse by construction: given three lengths satisfying the inequality, a triangle with exactly those sides can be built. So the condition is not merely necessary but sufficient — it settles the question completely. Wolfram MathWorld states the same three conditions explicitly for sides a, b and c: a + b > c, b + c > a, a + c > b, with all three lengths positive. The geometric content is that a straight line is the shortest path between two points: travelling from one vertex to another directly must be shorter than detouring via the third vertex, and if it is not shorter the detour is not a detour and the figure has collapsed onto a line. Fixing two sides a and b and solving the three conditions for the third gives |a − b| < c < a + b, an open interval of width 2 × min(a, b). Once a triple is known to be valid, its angles follow from the law of cosines without any trigonometry being computed: with L the longest side and p and q the other two, the triangle is acute when p² + q² > L², right-angled when p² + q² = L² (the converse of Pythagoras, Elements Book I, Proposition 48) and obtuse when p² + q² < L² (Elements Book II, Proposition 12). Only the longest side needs testing, because the largest angle always sits opposite it.
How to use this calculator.
- Pick the mode. Check tests three lengths you already have. Range takes two lengths and reports the interval the third must fall in.
- Enter sides a and b in any unit, as long as every length uses the same one. Both must be greater than zero.
- In check mode, enter the third length in side c. In range mode this field is ignored.
- Read the verdict. In check mode it is yes, no, or degenerate — degenerate meaning the third side exactly hits one of the bounds and the three corners fall on a straight line with zero enclosed area.
- When the answer is yes, read the classification in the same sentence: equilateral, isosceles or scalene by sides, and acute, right-angled or obtuse by angles, with the squares that decided it shown.
- Read the two bounds and the width underneath. The width is always twice the shorter of the two sides you entered, so if you need more freedom in the third side you have to lengthen the shorter one, not the longer one.
The formula.
Euclid's Book I, Proposition 20 gives three conditions at once: a + b > c, b + c > a and a + c > b. Fix a and b, treat c as the unknown, and rearrange each one. The first gives c < a + b directly. The second, b + c > a, gives c > a − b. The third, a + c > b, gives c > b − a. Since c has to beat both a − b and b − a, and one of those two is negative whenever a and b differ, the pair reduces to the single condition c > |a − b|. So the whole system is one open interval, |a − b| < c < a + b, and its width is (a + b) − |a − b|, which simplifies to twice the smaller of a and b.
Working the default: a = 5 and b = 7. The lower bound is |5 − 7| = 2 and the upper bound is 5 + 7 = 12, so the window is 10 units wide — twice 5, the shorter side. The supplied third side is 9, and 2 < 9 < 12, so the triangle exists.
Both bounds are strict. At c = 12 the sides of 5 and 7 lie end to end along the third side and the three corners are collinear; at c = 2 the side of 5 lies flat along the side of 7 and, again, all three corners are on one line. In both cases the enclosed area is exactly zero. Euclid's wording is "greater than", which excludes equality, and this page reports the equality case as its own outcome — degenerate — rather than silently choosing whether to call it a triangle.
CLASSIFYING A VALID TRIANGLE. Let L be the longest side and p and q the other two. The law of cosines says L² = p² + q² − 2pq·cos θ, where θ is the angle opposite L, so the sign of p² + q² − L² is the sign of cos θ. When p² + q² > L² the angle is under 90° and the triangle is acute; when p² + q² = L² it is exactly 90°, which is the converse of Pythagoras (Elements Book I, Proposition 48); when p² + q² < L² it is over 90° and the triangle is obtuse (Elements Book II, Proposition 12). Only the longest side needs checking, because the largest angle is always opposite the longest side, so if that one is acute the other two must be. For the default 5, 7, 9: the longest side is 9, and 9² = 81 exceeds 5² + 7² = 25 + 49 = 74, so the triangle is obtuse. Cross-checking with the law of cosines directly, cos θ = (25 + 49 − 81) ÷ (2 × 5 × 7) = −7 ÷ 70 = −0.1, giving θ ≈ 95.74° — obtuse, as classified, and note that the numerator is precisely the p² + q² − L² quantity whose sign the page tests.
ROUNDING STAGE. Every comparison is an exact decimal comparison at 40 significant digits, not a floating-point one. That matters at the boundaries: 3 + 4 = 7 and 3² + 4² = 5² are exact in decimal, but a route through double-precision square roots can miss either by one unit in the last place and report a right triangle as acute. Rounding happens once, at the return boundary, and only on the three numeric outputs — never on a value the verdict reads.
A worked example.
A student is asked whether 5, 7 and 9 can be the sides of a triangle and, if so, what kind. Leaving the mode on Check and entering a = 5, b = 7 and c = 9 returns the verdict "Yes — 5, 7 and 9 form a valid triangle. Classification: scalene (no two sides equal) and obtuse (9² = 81 exceeds 5² + 7² = 74). Given sides 5 and 7, the third side had to be strictly between 2 and 12." Underneath, the third side must exceed 2, must be under 12, and the allowed range is 10 units wide. Step by step: the lower bound is |5 − 7| = 2, the upper bound is 5 + 7 = 12, and 9 sits comfortably inside, so the triangle exists. The width of 10 is twice the shorter side, 5 — which is the general rule and the reason a very long second side buys the third side no extra freedom. For the shape: the longest side is 9, so compare 9² = 81 with 5² + 7² = 25 + 49 = 74. Since 81 is larger, the angle opposite the 9 is greater than 90° and the triangle is obtuse. All three lengths differ, so it is scalene. Change the third side to 12 and the verdict flips to degenerate: 5 and 7 laid end to end make exactly 12, so the three corners fall on one straight line and the enclosed area is zero. Change it to 13 and the verdict is a flat no — 13 is longer than 5 + 7 = 12, and the two shorter sides cannot reach across it however wide you open them. Switching to Range mode with the same 5 and 7 drops the third field entirely and reports the interval on its own: any length strictly between 2 and 12 works, and nothing outside it does.
Frequently asked questions.
What is the range of the third side of a triangle?
What happens at exactly a + b — is that a triangle?
How do I tell whether a triangle is acute, right or obtuse from just the three sides?
How is this different from the triangle solver?
Does the triangle inequality hold on a sphere?
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.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 977 calculators remain free
- No billing is enabled