Triangle Calculator — Solve Any Triangle From 3 Inputs
Type any 3 of 6 fields (sides a/b/c, angles A/B/C). Get the rest plus area, perimeter, heights, and classification.
What is triangle calculator?
A triangle has six measurable pieces: three sides and three angles. Knowing any three (with the constraint that you can’t use three angles alone) determines the other three. This calculator handles all five standard input cases: SSS (three sides), SAS (two sides and the angle between), ASA (two angles and the side between), AAS (two angles and a non-adjacent side), and the famously tricky SSA (two sides and an angle opposite one of them, which may produce zero, one, or two valid triangles).
Internally the solver dispatches on which 3 of 6 fields you provide. SSS goes straight to the law of cosines: each angle is recovered from arccos((b² + c² - a²) / (2bc)). SAS computes the third side from law of cosines, then law of sines for the remaining two angles. ASA and AAS both finish the angles by subtraction (since they sum to 180°), then use law of sines for the missing sides. SSA uses law of sines to find the angle opposite the second known side — and because sin has two solutions in (0°, 180°), checks whether one or both produce a valid triangle.
In addition to all six fields, the result panel shows Heron’s-formula area, perimeter, the three altitudes (h_a, h_b, h_c), and the triangle type as a two-word label like “right scalene”, “obtuse isosceles”, or just “equilateral”. Right-angle classification uses a 0.05° tolerance so that the 3-4-5 triangle and its scaled siblings reliably classify as “right” despite floating-point rounding.
Privacy is simple: every calculation runs in your browser. The values you type never leave your device, no state is saved, and there are no analytics on input values.
When to use a triangle calculator
- Trig homework — solve a SSS or SAS triangle — Type the three known fields (sides and/or angles). The calculator detects whether your inputs are SSS, SAS, ASA, AAS, or SSA and applies the appropriate law (law of cosines or law of sines). All six fields plus area, perimeter, and three heights appear in the result.
- Surveying — find a missing distance from two angles and a baseline — Classic surveying problem: you measure two angles from a known baseline and want the distances to a remote point. ASA mode handles this — type the two angles and the side BETWEEN them, and the other two sides come out via law of sines.
- Recognize the ambiguous SSA case — When you know two sides and an angle opposite one of them (SSA), there can be zero, one, or two valid triangles. The calculator handles all three: it returns null when no triangle fits, a single result when the inputs force a right angle, and both solutions when the case is genuinely ambiguous.
How to use the Triangle Calculator — Solve Any Triangle From 3 Inputs
- Type any 3 of 6 values — Side a is opposite angle A; side b is opposite angle B; side c is opposite angle C. Sides must be positive; angles must be strictly between 0° and 180°. Decimals are fine.
- Wait for the solver to fire automatically — As soon as exactly 3 fields are filled, the calculator detects the input case and computes the rest. With fewer than 3 it shows a hint; with more than 3 it asks you to clear one.
- Read all six values plus the stats — The result panel shows all 6 fields (sides + angles), the area (Heron's formula), the perimeter, the three altitudes (heights from each vertex), and the triangle type (right/obtuse/acute × scalene/isosceles/equilateral).
- Watch for SSA ambiguity — When you provide 2 sides and the angle opposite one of them, the calculator may return two valid triangles. Both are displayed side by side under an 'SSA ambiguous case' banner. Pick whichever matches your real-world constraints.
Worked examples
3-4-5 right triangle (SSS)
Input: a=3, b=4, c=5
Output: A ≈ 36.87°, B ≈ 53.13°, C = 90°, area = 6, perimeter = 12, type: right scalene The canonical Pythagorean triple. Useful for sanity-checking the SSS solver.
30-60-90 triangle (AAS)
Input: A=30, B=60, a=1
Output: C = 90°, b = √3 ≈ 1.7321, c = 2, area ≈ 0.866, type: right scalene Ambiguous SSA case
Input: a=4, b=6, A=30
Output: Two solutions. Sol 1: B ≈ 48.59°, C ≈ 101.41°, c ≈ 7.84. Sol 2: B ≈ 131.41°, C ≈ 18.59°, c ≈ 2.55. The 'SSA ambiguous' case has two valid triangles because <code>sin(B)</code> has two solutions in (0°, 180°).
Frequently asked questions
What are the SSS, SAS, ASA, AAS, and SSA cases?
Why is SSA called the ambiguous case?
sin(x) = sin(180° - x), a single sine value gives two possible angle measures in (0°, 180°). When you solve for the unknown angle via law of sines in SSA, both values may produce valid triangles — so the same SSA inputs can describe two different triangles. The calculator returns both when both are valid.How does the calculator classify triangle type?
How is the area computed?
area = √(s(s-a)(s-b)(s-c)) where s = (a+b+c)/2 is the semi-perimeter. The calculator first resolves all three sides (via law of cosines or law of sines, depending on input case), then applies Heron. For SAS specifically, the formula area = (1/2)·a·b·sin(C) would also work, but Heron gives the same answer with one fewer dependency on the angle.What are the heights (h_a, h_b, h_c)?
h_a is the altitude (perpendicular height) from vertex A to side a — the segment from A meeting side a at a right angle. It's computed as h_a = 2·area / a, and similarly for h_b and h_c. For a 3-4-5 right triangle: h_a = 4 (the side b acts as the altitude from A), h_b = 3, h_c = 2.4.Why does the calculator reject some inputs?
sin(B) > 1, which means no triangle is possible. When any invariant is violated, the calculator shows a hint instead of returning a nonsensical answer.Why is providing all 3 angles invalid?
Does this handle non-degree angles (radians)?
180/π first. We chose degrees for the default because that's what most geometry/trig textbooks and accessibility-ramp specs use; a radian toggle is a possible future addition.Are my numbers stored or sent anywhere?
localStorage writes.