Triangle Calculator

Enter any three values of a triangle — sides, angles or a mix, with at least one side — to solve every side and angle, the area, perimeter, heights, inradius and circumradius, with the law of sines or cosines worked through and the ambiguous case reported.

Enter any three values, including at least one side, and leave the rest blank. Angle A is opposite side a, B opposite b, C opposite c.

°
°
°

Area

6

Right scalene triangle · Three sides (SSS): law of cosines

  • Side a3
  • Side b4
  • Side c5
  • Angle A (opposite a)36.87°
  • Angle B (opposite b)53.13°
  • Angle C (opposite c)90°
  • Perimeter12
  • Heights to a, b, c4 · 3 · 2.4
  • Inradius · circumradius1 · 2.5
  • TypeRight, scalene
  • Area6

How this was calculated

cos A = (b² + c² − a²) ÷ 2bc = (16.000 + 25.000 − 9.000) ÷ 40.000 → A = 36.87°

cos B likewise → B = 53.13°; C = 180° − A − B = 90.00°

Area = ½ × a × b × sin C; s = perimeter ÷ 2; inradius = area ÷ s; circumradius = a ÷ (2 sin A)

How the calculator solves a triangle

Any three independent measurements of a triangle fix it — provided at least one is a side. The calculator looks at which three you entered, picks the right law, and shows the working. The one case with a twist is two sides and an angle that is not between them: the law of sines can then admit two different triangles, and both are reported.

What you know, and how it is solved
GivenCaseMethodNotes
Three sidesSSSLaw of cosines for each angleSides must satisfy the triangle inequality
Two sides and the angle between themSASLaw of cosines for the third side, then the anglesAlways exactly one triangle
Two sides and an angle opposite one of themSSALaw of sinesMay give two triangles, one, or none — the ambiguous case
Two angles and any sideASA / AASThird angle from 180°, then law of sinesAlways exactly one triangle
Three anglesAAAFixes the shape only; no size without a side

The Pythagorean theorem

In any right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c². The hypotenuse is always the longest side and always sits opposite the right angle.

Rearranged, the theorem finds any missing side. Given both legs, c = √(a² + b²). Given the hypotenuse and one leg, the other leg is √(c² − a²). This second form requires the hypotenuse to be longer than the known leg — otherwise no such triangle exists. For a right triangle, enter the two known sides and 90° for the angle between the legs, or the three sides if you have them.

The law of sines and the law of cosines

These two relations extend right-triangle trigonometry to every triangle. The law of sines says each side is proportional to the sine of its opposite angle, which links any angle–side pair to any other. The law of cosines generalises Pythagoras with a correction term for the included angle, and collapses back to a² + b² = c² when that angle is 90°, because cos 90° = 0.

Formulas the calculator uses
QuantityFormulaNotes
Law of sinesa ÷ sin A = b ÷ sin B = c ÷ sin CAny two angle–side pairs
Law of cosinesc² = a² + b² − 2ab cos CReduces to Pythagoras when C = 90°
Angle sumA + B + C = 180°Third angle from two
Area (two sides, included angle)½ ab sin C
Area (Heron)√[s(s−a)(s−b)(s−c)], s = (a+b+c)/2From three sides only
Height to side a2 × area ÷ a
Inradiusarea ÷ sCircle touching all three sides
Circumradiusa ÷ (2 sin A)Circle through all three corners

Finding the angles

The three trigonometric ratios relate the angles to the sides of a right triangle. For an acute angle θ: sin θ is the opposite side over the hypotenuse, cos θ is the adjacent over the hypotenuse, and tan θ is the opposite over the adjacent. The mnemonic SOH-CAH-TOA encodes all three.

In a general triangle the law of cosines does the same job: cos A = (b² + c² − a²) ÷ 2bc gives any angle from three sides. The angles of every triangle total 180°, which is a quick check on any result — and in a right triangle the two acute angles therefore sum to exactly 90°.

Exact trigonometric values worth knowing
AngleRadianssincostan
00 = 0.00001 = 1.00000 = 0.0000
30°0.1667π1/2 = 0.5000√3/2 = 0.8660√3/3 = 0.5774
45°0.25π√2/2 = 0.7071√2/2 = 0.70711 = 1.0000
60°0.3333π√3/2 = 0.86601/2 = 0.5000√3 = 1.7321
90°0.5π1 = 1.00000 = 0.0000undefined

Area and special triangles

For a right triangle the area is half the product of the legs. For any triangle it is half the product of two sides and the sine of the angle between them, or — from three sides alone — Heron's formula, which is what the calculator applies after solving.

Several triangles have exact integer or simple radical relationships worth recognizing. Pythagorean triples such as 3-4-5, 5-12-13, and 8-15-17 have whole-number sides. The 45-45-90 triangle has legs of equal length and a hypotenuse of leg × √2. The 30-60-90 triangle has sides in the ratio 1 : √3 : 2, which appears constantly in geometry and trigonometry.

Special triangles
TriangleSide ratioNotes
45-45-901 : 1 : √2Half a square; legs equal, hypotenuse leg × 1.4142
30-60-901 : √3 : 2Half an equilateral triangle; short leg is half the hypotenuse
Equilateral1 : 1 : 1, all angles 60°Area = (√3 ÷ 4) × side²
3-4-5 and multiples3 : 4 : 5Whole-number right triangle used to check square corners

Pythagorean triples

Whole-number right triangles. Every multiple of a triple is also a triple, and every primitive triple comes from Euclid's formula: for whole numbers m > n, the sides m² − n², 2mn and m² + n² always work.

Primitive Pythagorean triples and their multiples
Primitive tripleSome multiples
3, 4, 56-8-10, 9-12-15, 12-16-20
5, 12, 1310-24-26, 15-36-39
8, 15, 1716-30-34
7, 24, 2514-48-50
20, 21, 2940-42-58
9, 40, 4118-80-82

Where this gets used

Triangles answer a lot of practical questions. Construction uses the 3-4-5 triple to check that corners are square without a protractor. Navigation and mapping use the law of cosines for distance between two points seen from a third. Screen and television sizes are quoted as the diagonal, which is the hypotenuse of the display's width and height. Surveyors measure one baseline and two angles, then let the law of sines supply the distances they cannot walk.

It also generalizes: the distance formula between two points in a plane, √((x₂−x₁)² + (y₂−y₁)²), is the Pythagorean theorem applied to the horizontal and vertical separation.

Frequently asked questions

How do I find the hypotenuse of a right triangle?

Square both legs, add them, and take the square root: c = √(a² + b²). For legs of 3 and 4, c = √(9 + 16) = √25 = 5. In the calculator, enter the two legs and 90° for the angle between them.

How do I solve a triangle with two sides and an angle?

It depends where the angle is. If it is between the two sides (SAS), the law of cosines gives the third side directly. If it is opposite one of them (SSA), the law of sines gives the second angle — and there may be two valid triangles, one, or none, which the calculator reports.

What is the ambiguous case?

When you know two sides and an angle opposite the shorter of them, the unknown angle opposite the longer side can be acute or obtuse, and both may produce a valid triangle. Sine takes the same value for an angle and its supplement, so the arithmetic cannot choose between them; only the situation can.

What is a Pythagorean triple?

A set of three whole numbers that satisfy a² + b² = c², such as 3-4-5, 5-12-13, and 8-15-17. Any multiple of a triple is also a triple, so 6-8-10 works too. Builders use 3-4-5 to verify square corners.

How do I find the angles of a triangle from its sides?

Use the law of cosines: cos A = (b² + c² − a²) ÷ 2bc, then the inverse cosine. Repeat for a second angle and subtract both from 180° for the third. For a right triangle, the inverse tangent of opposite over adjacent is quicker.

Does the Pythagorean theorem work for all triangles?

No — only right triangles. For triangles without a right angle, use the law of cosines, c² = a² + b² − 2ab·cos(C), which reduces to the Pythagorean theorem when angle C is 90° because cos(90°) = 0.

Last reviewed . Results are estimates for informational purposes only.