Math & Education
Triangle Calculator
Solve any triangle from three known values (SSS, SAS or ASA): all sides, angles, area, perimeter and heights, using the law of sines and cosines.
How to use
- 1Choose what you know: three sides, two sides and the angle between them, or two angles and the side between them.
- 2Enter the values (angles in degrees).
How it's calculated
Law of cosines: c² = a² + b² − 2ab cos C. Law of sines: a ÷ sin A = b ÷ sin B = c ÷ sin C. Area by Heron's formula: √(s(s − a)(s − b)(s − c)), s = half the perimeter.
Frequently asked questions
Why isn't SSA an option?
Two sides and a non-included angle can give two different triangles (the ambiguous case). Use SSS, SAS or ASA for a unique answer.
What makes three sides a valid triangle?
Each side must be shorter than the other two combined (the triangle inequality).
How do I know if a triangle is right-angled?
If a² + b² = c² for the longest side c. The calculator reports the triangle type.
Worked example: the 3-4-5 triangle is a right triangle, found two ways
Given sides 3, 4, 5 (SSS mode), the calculator finds angle C opposite the side of length 5 using the law of cosines rearranged: cos C = (a² + b² − c²) ÷ (2ab) = (9 + 16 − 25) ÷ 24 = 0, so C = 90°, and the area by Heron's formula (√(s(s−a)(s−b)(s−c)) with s = 6) comes out to √(6×3×2×1) = √36 = 6. Enter the same triangle a different way — two sides of 5 and a 60° angle between them (SAS) — and the third side comes out to exactly 5 as well, because the law of cosines with a 60° angle (where cos 60° = 0.5) simplifies to an equilateral triangle.
Why SSA isn't one of the three options
Two sides and an angle that isn't between them can describe two different valid triangles — swing the non-included side and it can meet the opposite side at two different points, both satisfying the given measurements. This is the classic "ambiguous case" taught alongside the law of sines. SSS, SAS and ASA all pin down a triangle uniquely, which is why those are the only three input modes offered here.
The triangle inequality rejects impossible inputs before any trig runs
Before solving anything, the calculator checks that each side is shorter than the sum of the other two (a + b > c, and so on) — three sides like 2, 3, 10 fail this check because 2 + 3 = 5 is nowhere near long enough to reach 10, so no triangle can close with those lengths. This matters because without the check, the law of cosines would still spit out a numeric angle for impossible inputs, just not one that corresponds to a real shape.
Why 'obtuse equilateral' can never appear in the result
The type label combines two independent checks — comparing the largest angle to 90° for acute/right/obtuse, and comparing side lengths for equilateral/isosceles/scalene — but not every combination can actually occur. An equilateral triangle's three angles are always exactly 60° each, so its largest angle is always 60°, meaning 'equilateral' can only ever pair with 'Acute' in this tool's output; a result like 'Right, equilateral' or 'Obtuse, equilateral' isn't just unlikely, it's geometrically impossible, which is a reasonable thing to sanity-check if you're building something similar yourself and wondering whether to test for that combination.
Related tools
- Equation Solver (Linear & Quadratic)
Solve linear and quadratic equations in x — typed naturally like 3x + 5 = 2x - 7 or x^2 - 5x + 6 = 0 — with the discriminant, vertex and real or complex roots.
- Linear Inequality Solver
Solve linear inequalities in x like 3x − 5 < 7 or 2(x + 1) ≥ x − 4, flipping the sign correctly, with the answer in inequality and interval notation.
- Matrix Calculator
Multiply, add and subtract matrices, and find the determinant, inverse, transpose and rank — or solve a system of linear equations Ax = b.
- Scientific Calculator
A free online scientific calculator — type any expression with trig, logs, powers, roots, factorials, constants and unit-aware maths.
- Ideal Gas Law Calculator (PV = nRT)
Solve the ideal gas law for pressure, volume, moles or temperature — with unit choices for kPa, atm, bar, litres and °C, K or °F.
- Ohm's Law Calculator
Enter any two of voltage, current, resistance and power to calculate the other two with Ohm's law and the power formulas.