Triangle Calculator
Enter any three values, at least one a side. You get all sides and angles, the area and more, drawn to scale, with the law used and your numbers plugged in.
https://flxcode.com/triangle-calculator/
Fill in any three values, at least one a side. Side a sits opposite angle A, b opposite B, c opposite C.
Solved. Method: SSS.
Scalene, right triangle
- Side a
- 3
- Side b
- 4
- Side c
- 5
- Angle A
- 36.87°
- Angle B
- 53.13°
- Angle C
- 90°
- Area
- 6
- Perimeter
- 12
- Height to side a
- 4
- Height to side b
- 3
- Height to side c
- 2.4
- Inradius
- 1
- Circumradius
- 2.5
The steps, with your numbers
- Law of cosines: cos A = (b² + c² − a²) / (2 × b × c) = (4² + 5² − 3²) / (2 × 4 × 5) = 32 / 40 = 0.8, so A = 36.87°
- Law of cosines: cos B = (c² + a² − b²) / (2 × c × a) = (5² + 3² − 4²) / (2 × 5 × 3) = 18 / 30 = 0.6, so B = 53.13°
- Third angle: C = 180° − A − B = 180° − 36.87° − 53.13° = 90°
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.
Problem or idea? Email us
Which three values work
| You know | Name | How it is solved |
|---|---|---|
| Three sides | SSS | Law of cosines for two angles, then 180° minus both |
| Two sides and the angle between them | SAS | Law of cosines for the third side, then law of sines |
| Two angles and the side between them | ASA | Third angle from 180°, then law of sines |
| Two angles and another side | AAS | Same as ASA |
| Two sides and an angle not between them | SSA | Law of sines. There can be two answers, one, or none |
Three angles are not enough. A tiny triangle and a huge one can have the same three angles. Side a is always opposite angle A, b opposite B, c opposite C.
Worked examples
These were solved by the same code as the tool above, to three decimals.
| Case | You enter | Result |
|---|---|---|
| SSS | a = 3, b = 4, c = 5 | a = 3, b = 4, c = 5; A = 36.87°, B = 53.13°, C = 90° |
| SSS | a = 5, b = 12, c = 13 | a = 5, b = 12, c = 13; A = 22.62°, B = 67.38°, C = 90° |
| SAS | a = 8, b = 11, C = 40° | a = 8, b = 11, c = 7.084; A = 46.548°, B = 93.452°, C = 40° |
| ASA | A = 35°, B = 70°, c = 10 | a = 5.938, b = 9.728, c = 10; A = 35°, B = 70°, C = 75° |
| AAS | A = 40°, B = 65°, a = 12 | a = 12, b = 16.92, c = 18.033; A = 40°, B = 65°, C = 75° |
| SSA | a = 7, b = 10, A = 30° | Triangle 1: a = 7, b = 10, c = 13.559; A = 30°, B = 45.585°, C = 104.415° Triangle 2: a = 7, b = 10, c = 3.761; A = 30°, B = 134.415°, C = 15.585° |
| SSA | a = 3, b = 10, A = 30° | No triangle: sin B would be 1.667, and a sine can't be above 1. Side a is too short to reach the other side from this angle. |
Check the first one by hand: 3² + 4² = 25 = 5², so the angle opposite the 5 is exactly 90°. The 6, 6, 6 triangle has three 60° angles and an area of 15.588.
What it calculates
- Law of cosines:
c² = a² + b² − 2ab cos C. Rearranged,cos C = (a² + b² − c²) / 2ab. - Law of sines:
a / sin A = b / sin B = c / sin C. - Angles add up to 180° (π radians).
- Area from Heron's formula,
√(s(s − a)(s − b)(s − c)), withs = (a + b + c) / 2. - Height to side a:
h = 2 × area / a. Same for b and c. - Inradius
r = area / s. CircumradiusR = abc / (4 × area). - Type: equilateral, isosceles or scalene by the sides, and acute, right or obtuse by the largest angle.
Numbers this uses
- The angles of a triangle add up to 180° (Euclid, Elements I.32).
- π is the double-precision value 3.141592653589793 that your browser has built in.
- Two sides count as equal, and an angle as right, when they agree within one part in a billion (1e-9). This only decides the label "isosceles" or "right", never the result.
- Values above 1,000,000,000,000 are rejected so the arithmetic stays accurate.
- The "Decimals" box only rounds what is shown. The calculation itself keeps full precision.
Two triangles, one, or none
Only the SSA case can do this. The side opposite the angle you gave is the one that swings. If it is shorter than the other side and long enough to reach the base, two triangles fit. If it is at least as long as the other side, there is one. If it is too short, there is none, and the tool says so. Example: a = 3, b = 10, A = 30° gives no triangle, because the shortest distance from the corner to the base is 10 × sin 30° = 5, and 3 is less than that.
For more on this case see the law of sines calculator. For three sides or two sides and the angle between them see the law of cosines calculator. For a right triangle with two known sides, the Pythagorean theorem calculator is quicker.
Limits
- Flat (Euclidean) triangles only. Triangles on a sphere, such as on the Earth, have angles that add up to more than 180° and need spherical trigonometry.
- Exact roots such as √2 are shown for sides when the square is a whole number. Everything else is a decimal.
- The drawing is to scale but it is not a plan. Use it to see the shape.
Nothing you type is uploaded. We count events without cookies (details).
FAQ
What do I need to enter to solve a triangle?
Any three values, and at least one of them must be a side. Three sides, two sides and an angle, or one side and two angles all work. Three angles alone give only the shape of the triangle, not its size, so the tool asks you to swap one angle for a side.
What do SSS, SAS, ASA, AAS and SSA mean?
They name what you know, in order around the triangle. SSS is three sides. SAS is two sides and the angle between them. ASA is two angles and the side between them. AAS is two angles and a side that is not between them. SSA is two sides and an angle that is not between them. SSA is the tricky one.
Why does it sometimes show two triangles?
With two sides and an angle that is not between them (SSA), the shorter side can swing to two different positions and still touch the base. Try a = 7, b = 10, A = 30°. B can be 45.58° or 134.42°, and both make a real triangle. This is called the ambiguous case. The law of sines page explains when it happens.
Why does it say "no triangle"?
The numbers contradict each other. Three sides where the two shorter ones add up to less than the longest, or exactly the longest, cannot close. Two angles that add up to 180° or more leave nothing for the third. In the SSA case, a side that is too short to reach the base gives a sine above 1, which is impossible.
How is the area calculated?
With Heron's formula, from the three sides. The semi-perimeter is s = (a + b + c) / 2, and the area is √(s(s − a)(s − b)(s − c)). For 3, 4, 5 that is √(6 × 3 × 2 × 1) = 6. The tool uses a form of the formula that stays accurate for very thin triangles.
What are the inradius and circumradius?
The inradius is the radius of the biggest circle that fits inside the triangle: area divided by the semi-perimeter. The circumradius is the radius of the circle through all three corners: abc divided by 4 times the area. For a 3, 4, 5 triangle they are 1 and 2.5. The circumradius of a right triangle is half the hypotenuse.
Can I use radians?
Yes. Switch "Angles in" to radians. Angles you already typed are converted so they keep their meaning. In radians the answers also show the multiple of π when there is a simple one, such as 1.5708 rad (π/2). For a plain conversion see degrees to radians.
Are my numbers uploaded or saved?
No. The maths runs in your browser. What you type is not put in the address bar, not stored and not counted. We only count which case was solved, such as SSS.
More from FLXCode
Law of Sines CalculatorNew
Solve ASA, AAS and SSA triangles. Shows both triangles in the ambiguous case, or says none exists.
Law of Cosines CalculatorNew
Solve SSS and SAS triangles. Shows the formula with your numbers, every angle and every side.
Pythagorean Theorem CalculatorNew
Find the missing side of a right triangle, or test if three sides make one. Exact roots and the steps.
Area CalculatorNew
Area of a rectangle, triangle, circle, trapezoid, parallelogram, ellipse, sector or polygon, with the formula.