Triangle Calculator
SSS, SAS, ASA, AAS and the ambiguous SSA case — which can have two answers.
Updated
cm
cm
cm
The solved triangle
6cm²
A scalene right triangle. The three angles sum to exactly 180°, which is a check rather than a coincidence.
- Side a
- 3 cm
- Side b
- 4 cm
- Side 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.
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
SSS
Check the triangle inequality, then derive stable area and all three angles.
- 2
SAS
Use the included angle to calculate the opposite side and area.
- 3
ASA or AAS
Find the third angle by subtraction and scale the sides with the law of sines.
- 4
SSA
Solve a quadratic for every positive third-side candidate and validate each triangle.
- 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.
- 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°.
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 inputs | Checkable working | Result |
|---|---|---|
| SSS: a = 3, b = 4, c = 5 | 3² + 4² = 5²; K = 3 × 4 ÷ 2; P = 3 + 4 + 5 | A = 36.87°, B = 53.13°, C = 90°; K = 6; P = 12; right scalene |
| SSS: 7, 7, 0.00000002 | K = ¼√((14.00000002)(0.00000002)(0.00000002)(13.99999998)) | Stable K = 0.00000007; textbook result = 0.00000006999999957 |
| SSS: 2, 3, 6 | 2 + 3 = 5 ≤ 6, so the shortest two sides cannot close | K = 0; invalid triangle with an explanation |
| SAS: a = 5, C = 60°, b = 7 | c² = 5² + 7² − 2 × 5 × 7 × cos 60° = 39; K = 5 × 7 × sin 60° ÷ 2 | c = √39; K = 35√3/4; P = 12 + √39; acute scalene |
| ASA: A = 45°, B = 45°, c = 10 | C = 180° − 45° − 45° = 90°; a = b = 10sin45° = 5√2 | a = b = 5√2; K = 25; P = 10 + 10√2; right isosceles |
| AAS: A = 30°, B = 90°, a = 5 | C = 60°; b = 5/sin30° = 10; c = 10sin60° = 5√3 | a = 5; b = 10; c = 5√3; K = 25√3/2; right scalene |
| Base and height: base = 12, h = 5 | K = 12 × 5 ÷ 2 | K = 30; sides, angles, perimeter and radii undetermined |
| SSA: A = 30°, a = 8, b = 12 | c = 12cos30° ± √(8² − 12²sin²30°) = 6√3 ± 2√7 | 2 triangles: (B, C) = (48.59°, 101.41°) or (131.41°, 18.59°); both obtuse |
| SSA: A = 30°, a = 6, b = 12 | a² − b²sin²A = 36 − 36 = 0; c = 12cos30° = 6√3 | 1 triangle: B = 90°, C = 60°; K = 18√3; right scalene |
| SSA: A = 30°, a = 5, b = 12 | a² − b²sin²A = 25 − 36 = −11 | 0 triangles; the quadratic has no real third side |
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.
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)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.
Questions people ask
Sources
Where the constants and formulas on this page come from. Each line names the figure it backs.
Supports the relationships among triangle sides, angles, area, radii and classifications.
Triangle — Wolfram MathWorld
Supports the classical relationship between three side lengths and triangle area.
Heron's Formula — Wolfram MathWorld
Supports solving side-angle relationships through the law of cosines.
Law of Cosines — Wolfram MathWorld
Supports the stable rearrangement used for the area and angles of needle-like triangles.
Miscalculating Area and Angles of a Needle-like Triangle — W. Kahan, University of California, Berkeley
Related guides
How to Find the Volume of Hollow, Partial, and Composite Solids
A decomposition-first guide to pipes, frustums, domes, and partly filled tanks, with formulas and checks for avoiding geometric and unit errors.
August 12, 2026 · 12 min read
How to Compare Two Data Sets: Center, Spread, and Relative Difference
A practical workflow for deciding whether two sets are comparable, describing their typical values and variation, and reporting differences without overstating them.
August 11, 2026 · 10 min read
Putting JSON in a URL: Validate, Minify, Percent-Encode, or Base64url?
A decision guide for flattening, encoding, checking, and safely transporting JSON in a query string.
August 11, 2026 · 9 min read