Skip to main content
MathFree · no sign-up

Triangle Calculator

SSS, SAS, ASA, AAS and the ambiguous SSA case — and it names the triangle isosceles, equilateral or right.

Updated

What do you know?

cm

cm

The solved triangle

5cm

The hypotenuse, from a² + b² = c². A scalene right triangle with area 6 cm².

Leg a
3 cm
Leg b
4 cm
Hypotenuse c
5 cm
Angle A
36.87°
Angle B
53.13°
Angle C
90.00°
Area
6 cm²
Perimeter
12 cm
Inradius
1 cm
Circumradius
2.5000 cm

The area comes from a rearrangement of Heron's formula that stays accurate on long thin triangles. The textbook version subtracts nearly equal numbers there and loses most of its significant digits.

Advertisement

In short

Which triangle measurements can the calculator solve?

Choose 1 of 6 modes: SSS, SAS, ASA, AAS, base and height, or SSA. Complete triangles return sides, angles, area, perimeter, radii, height and classifications. SSA may return 0, 1 or 2 triangles; base and height return area without inventing a triangle.

Three angles fix shape, not size.

How to use the triangle calculator

Choose a mode before entering measurements

SSS uses three sides. SAS uses two sides and the angle between them. ASA uses two angles and their included side, while AAS uses two angles and a non-included side. SSA handles two sides with an angle that is not between them and must be treated separately.

  1. 1

    SSS

    Check the triangle inequality, then derive stable area and all three angles.

  2. 2

    SAS

    Use the included angle to calculate the opposite side and area.

  3. 3

    ASA or AAS

    Find the third angle by subtraction and scale the sides with the law of sines.

  4. 4

    SSA

    Solve a quadratic for every positive third-side candidate and validate each triangle.

  5. 5

    Base and height

    Return the area while leaving unsupported sides and angles undetermined.

Three side lengths must pass the triangle inequality: the sum of any two sides must exceed the third. Lengths 2, 3 and 6 fail because 2 + 3 ≤ 6. Rather than allowing a square root to become NaN, the calculator returns zero area and explains that the lengths cannot close.

For sides 7, 7 and 0.00000002, the exact area used here is 0.00000007. The textbook semiperimeter calculation returns 0.00000006999999957 in ordinary floating-point arithmetic, while the stable rearrangement returns 0.00000007 without losing the seventh significant figure.

The two-solution SSA case
Inputs
A = 30°, a = 8, b = 12
Quadratic discriminant
a² − b²sin²A = 64 − 36 = 28
Third sides
c = 6√3 ± 2√7
First angle pair
B = 48.59°, C = 101.41°
Second angle pair
B = 131.41°, C = 18.59°
Valid results
2 different triangles, both obtuse

The two possible B angles are supplements: 48.59° + 131.41° = 180°.

Advertisement

The SSA solver treats the third side as the unknown in a law-of-cosines quadratic. This avoids relying on inverse sine near its worst-conditioned boundary. For A = 30°, a = 6 and b = 12, the discriminant is zero and the single result has B = 90°, not a slightly acute approximation.

0, 1 or 2

SSA results

Every valid branch is returned

180°

Angle total

The third angle is found by subtraction

Area only

Base and height

The full triangle remains undetermined

For a completed triangle, two angles come from the law of cosines and the third is calculated as 180° minus their sum. This prevents three independently rounded inverse-cosine results from displaying an angle total such as 59.99° + 60.00° + 60.00°.

Base and perpendicular height determine area but not the triangle. The apex may slide along a line parallel to the base while preserving both measurements. Side lengths, angles, perimeter, inradius and circumradius therefore remain unavailable rather than being filled with assumed values.

Do

  • Keep each lowercase side opposite its matching uppercase angle.
  • Check all SSA branches before deciding how many triangles exist.
  • Use the triangle inequality before interpreting an SSS result.
  • Treat base and height as an area-only mode.

Don't

  • Assume every SSA input has one solution.
  • Describe the standard A = 30°, a = 8, b = 12 pair as one acute and one obtuse triangle.
  • Assume three angles determine the scale of a triangle.
  • Use a sloping side as a perpendicular height.

Completed results also include height to side a, inradius, circumradius and two classifications. The angle classification is right, acute or obtuse. The side classification is equilateral, isosceles or scalene. These labels describe the solved geometry and are not inferred for base-and-height-only input.

Solve the quadratic directly

Use the quadratic formula calculator when the underlying polynomial and both algebraic roots are the main result.

Open quadratic calculator

Worked triangle cases showing supported modes, stable SSS arithmetic and every SSA outcome

Mode and inputsCheckable workingResult
SSS: a = 3, b = 4, c = 53² + 4² = 5²; K = 3 × 4 ÷ 2; P = 3 + 4 + 5A = 36.87°, B = 53.13°, C = 90°; K = 6; P = 12; right scalene
SSS: 7, 7, 0.00000002K = ¼√((14.00000002)(0.00000002)(0.00000002)(13.99999998))Stable K = 0.00000007; textbook result = 0.00000006999999957
SSS: 2, 3, 62 + 3 = 5 ≤ 6, so the shortest two sides cannot closeK = 0; invalid triangle with an explanation
SAS: a = 5, C = 60°, b = 7c² = 5² + 7² − 2 × 5 × 7 × cos 60° = 39; K = 5 × 7 × sin 60° ÷ 2c = √39; K = 35√3/4; P = 12 + √39; acute scalene
ASA: A = 45°, B = 45°, c = 10C = 180° − 45° − 45° = 90°; a = b = 10sin45° = 5√2a = b = 5√2; K = 25; P = 10 + 10√2; right isosceles
AAS: A = 30°, B = 90°, a = 5C = 60°; b = 5/sin30° = 10; c = 10sin60° = 5√3a = 5; b = 10; c = 5√3; K = 25√3/2; right scalene
Base and height: base = 12, h = 5K = 12 × 5 ÷ 2K = 30; sides, angles, perimeter and radii undetermined
SSA: A = 30°, a = 8, b = 12c = 12cos30° ± √(8² − 12²sin²30°) = 6√3 ± 2√72 triangles: (B, C) = (48.59°, 101.41°) or (131.41°, 18.59°); both obtuse
SSA: A = 30°, a = 6, b = 12a² − b²sin²A = 36 − 36 = 0; c = 12cos30° = 6√31 triangle: B = 90°, C = 60°; K = 18√3; right scalene
SSA: A = 30°, a = 5, b = 12a² − b²sin²A = 25 − 36 = −110 triangles; the quadratic has no real third side
Angles are in degrees; displayed decimal angles are rounded to 2 places, while exact radicals are retained where useful.

Isosceles angles, the hypotenuse, and the special triangles

An isosceles triangle has two equal sides, and the angles opposite those sides are equal too. That single fact is the whole method: the two base angles match, all three angles total 180 degrees, and knowing any one angle therefore gives you the other two without measuring anything.

If you know the apex angle, the one between the two equal sides, subtract it from 180 and halve what is left. If instead you know a base angle, double it and subtract from 180 to get the apex. There is no trigonometry in either direction and no need for any side length at all.

Both directions, on one triangle
Apex angle given as
40 degrees
180 minus 40
140
Halved
each base angle is 70 degrees
Working back from a base angle
180 - (2 x 70) = 40
Check
40 + 70 + 70 = 180

To confirm the full triangle including its sides, enter the two base angles and the side between them in ASA mode above. The calculator will report the third angle, both remaining sides, the area, and the classification.

One constraint is worth knowing before you build an isosceles triangle from two measurements rather than from an angle. With two equal legs of length a and a base of length b, the triangle only exists when b is less than 2a. At exactly 2a the two legs lie flat along the base and enclose nothing, and beyond it they cannot reach across.

The hypotenuse, and the two triangles worth memorising

The hypotenuse is the side opposite the right angle, and it is always the longest side of a right triangle. It is conventionally labelled c, opposite angle C. The name is Greek and literally describes the position: the side stretching under the right angle.

Finding it from the two shorter sides is the Pythagorean theorem, c = the square root of (a squared plus b squared). Going the other way, a missing leg is the square root of (c squared minus a squared). In this calculator the natural route is SAS: enter one leg, an included angle of 90 degrees, and the other leg, and the third side returned is the hypotenuse.

The two special right triangles
45-45-90
sides in the ratio 1 : 1 : sqrt(2)
30-60-90
sides in the ratio 1 : sqrt(3) : 2
45-45-90 is isosceles
two equal angles, so two equal sides
30-60-90 is scalene
three different angles, three different sides

They are called special because their side ratios are fixed and exact, so a single known side gives the other two without a calculator. Every other right triangle needs trigonometry.

That table answers two questions the search results ask constantly and none of them answers cleanly. A 45-45-90 triangle is isosceles, but the reverse does not hold: most isosceles triangles are not right-angled at all, and the 45-45-90 is simply the one that is. And a 30-60-90 is never isosceles, because no two of its angles are equal.

Why no Pythagorean triple is ever a 30-60-90
The 30-60-90 ratio
1 : sqrt(3) : 2
sqrt(3) is
irrational, about 1.7320508
A Pythagorean triple is
three whole numbers
So the middle side
can never be a whole number
The two never meet
3-4-5 has angles of about 36.87 and 53.13 degrees

The smallest Pythagorean triple, 3-4-5, is a perfectly good right triangle and is not a special triangle: its acute angles are awkward decimals. The special triangles have tidy angles and untidy sides; the triples have tidy sides and untidy angles, and nothing has both.

Why SSA can produce two triangles

With A and its opposite side a fixed, another side b can sometimes swing into two positions. The corresponding angle B is acute in one position and its obtuse supplement in the other. Both candidates must still leave a positive third angle.

For A = 30°, a = 8 and b = 12, the resulting B values are 48.59° and 131.41°. The first triangle is obtuse at C = 101.41°, while the second is obtuse at B = 131.41°. Neither completed triangle is acute.

Why the SSS area formula is rearranged

The familiar semiperimeter form is mathematically correct, but its floating-point evaluation can lose precision when one side is tiny compared with the other two. Intermediate subtraction then removes matching leading digits before the remaining factors are multiplied.

Kahan’s rearrangement sorts the side lengths and groups the factors to reduce that cancellation. It also allows a failed triangle inequality to be identified before taking a square root, producing zero with an explanation instead of NaN.

Why three angles do not determine size

Triangles with the same three angles are similar, but they may have any positive scale. A triangle with sides 3, 4 and 5 has the same angles as one with sides 6, 8 and 10, while its perimeter and area are different.

Advertisement

The formula, worked line by line

Sides a, b and c lie opposite angles A, B and C. A complete solution uses the selected mode to recover all missing sides and angles before calculating area, perimeter, height, radii and classifications.

The area symbol K is used below to avoid confusing area with angle A. In SSS mode, the sides are additionally sorted as x ≥ y ≥ z before the stable area expression is evaluated.

K = ¼√((x + (y + z))(z − (x − y))(z + (x − y))(x + (y − z)))
A = arccos((b² + c² − a²)/(2bc))
B = arccos((a² + c² − b²)/(2ac))
C = 180° − A − B
a² = b² + c² − 2bc cos A
a/sin A = b/sin B = c/sin C
SSA: c = b cos A ± √(a² − b²sin²A)
Base and height: K = bh/2
P = a + b + c
hₐ = 2K/a
r = K/s, where s = P/2
R = abc/(4K)
One set of measurements, two trianglesWith angle A of 30 degrees, side a of 8 and side b of 12, two different triangles fit. In one, angle B is 48.59 degrees; in the other it is 131.41 degrees. The two add to 180.THE AMBIGUOUS SSA CASEB = 48.59°c = 15.68, area 47.05B = 131.41°c = 5.1, area 15.3A = 30°, a = 8, b = 12 — and 48.59° + 131.41° = 180°
The ambiguous case drawn twice: angle A of 30°, side a of 8 and side b of 12 give two different triangles, whose values of angle B are 48.59° and 131.41° and add to 180°.

Kahan’s area expression is algebraically equivalent to Heron’s formula but arranges the factors to reduce damaging cancellation in needle-shaped triangles. The triangle inequality is checked before its square root is evaluated.

The SSA quadratic can have a negative, zero or positive discriminant. After geometric validation, those cases produce zero, one or as many as two distinct triangle solutions.

Two angles are calculated from side relationships and the third by subtraction from 180°. This makes the displayed angle total exact under the calculator’s rounding convention.

Advertisement

Questions people ask

How do you find the angles of an isosceles triangle?

The two angles opposite the equal sides are equal, and all three total 180 degrees. If you know the apex angle, subtract it from 180 and halve the rest: an apex of 40 gives base angles of 70 each. If you know a base angle, double it and subtract from 180 to get the apex.

Are all isosceles triangles 45-45-90?

No. A 45-45-90 triangle is isosceles, because two equal angles force two equal sides, but it is the only isosceles triangle that is also right-angled. An isosceles triangle can have any apex angle between 0 and 180 degrees, and almost all of them are acute or obtuse rather than right.

Is an isosceles triangle 180 or 360 degrees?

180, like every triangle in ordinary plane geometry. An isosceles triangle is not a special case in that respect. What makes it isosceles is that two of those 180 degrees are equal to each other, which is why knowing one angle is enough to find all three.

How do you find the hypotenuse?

Take the square root of the sum of the squares of the two shorter sides: c = sqrt(a squared + b squared). For legs of 3 and 4 that is sqrt(9 + 16) = sqrt(25) = 5. In this calculator, pick the right triangle mode and enter the two legs; the hypotenuse comes back as the headline figure, with the area, the perimeter and both acute angles under it. That mode is SAS with the right angle already supplied, so it agrees exactly with entering 3, 90 degrees and 4 by hand.

Are Pythagorean triples ever 30-60-90 triangles?

No, and they cannot be. A 30-60-90 triangle has sides in the ratio 1 : sqrt(3) : 2, and sqrt(3) is irrational, so the middle side is never a whole number. The smallest triple, 3-4-5, has acute angles of roughly 36.87 and 53.13 degrees rather than 30 and 60.

Why can SSA return two triangles?

The known non-included angle and two sides may allow the second known side to occupy two positions. The corresponding angle is acute in one triangle and its obtuse supplement in the other, provided both completed geometries remain valid.

Are the two A = 30°, a = 8, b = 12 triangles acute and obtuse?

No, and the shorthand is worth correcting because it is so widely repeated. Both are obtuse. One has B = 48.59° and C = 101.41°, so C is the obtuse angle. The other has B = 131.41° and C = 18.59°, so B is. What actually separates the pair is that the two values of B are supplements.

Why use Kahan’s version of Heron’s formula?

The textbook semiperimeter form can lose significant digits when a triangle is extremely thin. Kahan’s rearrangement groups sorted-side factors more stably, reducing cancellation while remaining algebraically equivalent to Heron’s formula for valid triangles.

What happens when three sides cannot form a triangle?

The calculator checks the triangle inequality before evaluating the area square root. If two sides do not add to more than the third, it returns zero area and explains that the lengths cannot close instead of returning NaN.

Why are the three angles forced to total 180 degrees?

Three independent inverse-cosine calculations can round separately and display a total slightly below or above 180°. The calculator finds two angles from the law of cosines and obtains the third by subtraction, preserving the displayed total.

Does base and height determine the complete triangle?

No. Those measurements determine area through K = bh/2, but the apex can slide along a line parallel to the base. The sides, angles, perimeter, inradius and circumradius therefore remain undetermined.

Do three angles determine a triangle?

They determine its shape but not its scale. Multiplying every side by the same positive factor leaves all three angles unchanged while changing the perimeter, area, heights, inradius and circumradius. A 3-4-5 and a 6-8-10 have identical angles, twice the perimeter and four times the area, so three angles can never be enough input.

Sources

Where the constants and formulas on this page come from. Each line names the figure it backs.

  1. Supports the relationships among triangle sides, angles, area, radii and classifications.

    TriangleWolfram MathWorld

  2. Supports the classical relationship between three side lengths and triangle area.

    Heron's FormulaWolfram MathWorld

  3. Supports solving side-angle relationships through the law of cosines.

    Law of CosinesWolfram MathWorld

  4. Supports the stable rearrangement used for the area and angles of needle-like triangles.

    Miscalculating Area and Angles of a Needle-like TriangleW. Kahan, University of California, Berkeley