Audited 29 Jul 2026·Last updated 31 Jul 2026·4 citations·Tier 3·0 uses

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

What do you want to know?
The first known side. Any unit — all three lengths must use the same one. Must be greater than zero.
units
The second known side. In range mode these two sides are all the calculator needs.
units
The third length you want tested against the other two. Ignored in range mode.
units
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.
Whether the three lengths form a triangle, and if they do, the classification by sides (equilateral, isosceles or scalene) and by angles (acute, right-angled or obtuse). A length exactly equal to either bound is reported as degenerate — the three points fall on a straight line and the enclosed area is zero — rather than being folded into yes or no.
Third side must exceed
2units
Third side must be under
12units
Width of the allowed range
10units

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.

  1. Pick the mode. Check tests three lengths you already have. Range takes two lengths and reports the interval the third must fall in.
  2. Enter sides a and b in any unit, as long as every length uses the same one. Both must be greater than zero.
  3. In check mode, enter the third length in side c. In range mode this field is ignored.
  4. 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.
  5. 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.
  6. 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.

|a − b| < c < a + b

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.

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.

modecheck
side C9
side B7
side A5

Frequently asked questions.

What is the range of the third side of a triangle?
Strictly greater than the difference of the two known sides and strictly less than their sum: |a − b| < c < a + b. With sides of 5 and 7 the third side must be between 2 and 12, not including either end. The width of that window, (a + b) − |a − b|, always simplifies to twice the shorter of the two known sides — 10 in this case. That is a useful shortcut: the freedom you have in the third side is set entirely by the shorter of the two you already have, so making the longer side longer does not widen the range at all.
What happens at exactly a + b — is that a triangle?
It is the degenerate case, and this page reports it as its own outcome rather than lumping it in with yes or no. If the third side equals a + b exactly, the two shorter sides lie end to end along it and all three corners fall on a single straight line, so the enclosed area is zero. The same thing happens at the other end, when the third side equals |a − b|. Euclid's Book I, Proposition 20 says the sum of two sides must be "greater than" the third — a strict inequality that excludes equality — and MathWorld states the conditions strictly too. Some textbooks still call the collapsed figure a degenerate triangle and allow it; others say no triangle exists. The verdict here tells you which case you are in and leaves the naming to your course.
How do I tell whether a triangle is acute, right or obtuse from just the three sides?
Compare the square of the longest side with the sum of the squares of the other two. If the longest side squared is smaller, the triangle is acute; equal, and it is right-angled; larger, and it is obtuse. For 5, 7, 9: 9² = 81 versus 5² + 7² = 74, so obtuse. You only need to test the longest side, because the largest angle always sits opposite it — if that angle is under 90° the other two must be as well. The rule is a corollary of the law of cosines, and Euclid states the obtuse and acute cases as Book II, Propositions 12 and 13, with the right-angle case being the converse of Pythagoras at Book I, Proposition 48.
How is this different from the triangle solver?
Quanta's triangle solver takes three measurements and returns all six elements of the triangle plus its area and perimeter. It validates the triangle inequality internally, so typing 1, 2 and 10 into its SSS mode does produce an error telling you no such triangle exists — that much overlaps with this page. What it cannot do is take only two sides. "I have a 5 and a 7, what can the third side be?" is not a question a solver requiring three measurements can accept, and that is this page's range mode. Use this page to decide whether a triple works and what shape it makes; use the triangle solver once you know it does and you want the angles and the area.
Does the triangle inequality hold on a sphere?
For the lengths, yes — the sides of a spherical triangle measured as great-circle arcs satisfy the same inequality, because a great-circle arc is still the shortest path between two points on the surface. The classification on this page does not carry over. Spherical triangles have angle sums strictly greater than 180° and can have two or even three right angles at once, so comparing the square of the longest side with the sum of the squares of the other two tells you nothing about the angles. Everything on this page assumes flat, Euclidean geometry: a triangle drawn on paper, cut from sheet material, or laid out on a site small enough that the curvature of the earth does not matter.

References& sources.

  1. [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. [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. [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. [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
Coming soon