Audited 29 Jul 2026·Last updated 28 Oct 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 given two sides. Valid triangles are also classified.

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 lengths form a triangle (yes, no, or degenerate) and, when they do, its type by sides and by angles.
Third side must exceed
2units
Third side must be under
12units
Width of the allowed range
10units

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.

  1. 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.
  2. Enter the lengths in one unit. Any positive value works; zero and negative lengths are refused.
  3. In Check mode, enter the third length in side c. Range mode ignores that field.
  4. 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.

|a − b| < c < a + b

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.

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.

modecheck
side C9
side B7
side A5

Frequently asked questions.

Do I have to test all three inequalities?
No. If the two shorter lengths add up to more than the longest, the other two inequalities hold automatically, because the longest side plus anything positive already exceeds each of the shorter ones. Sort the lengths and make one comparison.
Why is the range always twice the shorter side?
The upper limit is a + b and the lower is the difference between them. Subtracting, the longer side cancels and twice the shorter one is left. With 5 and 7 that is 12 − 2 = 10; with 5 and 70 the range runs from 65 to 75, still exactly 10 wide.
Is a side exactly equal to the sum of the other two allowed?
Not as a proper triangle. With 5, 7 and 12, the 5 and 7 lie end to end along the 12 and the shape has zero area. Euclid's wording requires the sum to be greater, so the case is excluded; it is reported as degenerate in case your course names it that way.
How can three sides alone tell me whether a triangle is right-angled?
Compare the square of the longest side with the sum of the squares of the other two. Equal means a right angle, as with 3, 4 and 5 where 9 + 16 = 25. Make the third side 4.9 and 24.01 falls short of 25, so the triangle is acute; make it 5.1 and 26.01 exceeds 25, so it is obtuse.
Does the triangle inequality work on a globe?
For the side lengths, yes, measured as great-circle arcs, because those are still the shortest paths on the surface. The angle test does not carry over: a spherical triangle's angles add up to more than 180°, and one can even have three right angles, so the squares comparison means nothing there.

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.

How this page was produced

Published by
Quanta Calculator
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
Coming soon