Triangle Calculator
Type any three sides or angles and get the rest: area, perimeter, heights, medians and circles, with a drawing and every step. Right triangles need just two values (Pythagoras).
Fill in any three boxes, with at least one side. Leave the other three empty. Side a is opposite angle A, and so on.
The right angle is C. Fill in any two boxes, with at least one side. The hypotenuse c is the long side opposite the right angle.
Type the x and y of each corner. The sides, angles and area come from the distances between the points.
You can type fractions and roots: 1 1/2, 3/4, √2, 2√3, or π/6 for radians.
How your triangle is worked out
Start from what you know, use the law of cosines or sines, then the angle sum, then the area.
- 1
Three sides
a=5 b=6c=7SSS: find the rest
- 2
Law of cosines
cos A =(b²+c²−a²)/2bcA = 44.42°
- 3
Then the rest
B = 57.12°C = 78.46°
- 4
Area
s = 9√(s(s−a)(s−b)(s−c))= 14.6969
Read more: the formulas, a worked example, the ambiguous case and triangle types
A triangle has three sides (a, b, c) and three angles (A, B, C). Side a sits opposite angle A, b opposite B and c opposite C. Three of these six values fix the triangle, as long as at least one is a side. The calculator spots which case you have and uses the law of cosines, the law of sines and the fact that the angles add up to 180°. A right triangle needs only two values, because the third (the 90° angle) is already known.
The formula
Law of cosines: c² = a² + b² − 2 × a × b × cos C, so cos C = (a² + b² − c²) ÷ (2 × a × b)
Law of sines: a ÷ sin A = b ÷ sin B = c ÷ sin C = 2 × circumradius
Angle sum: A + B + C = 180° (π radians)
Pythagoras (right angle at C): c² = a² + b²
Area (Heron): s = (a + b + c) ÷ 2, area = √(s × (s − a) × (s − b) × (s − c))
Area (two sides and the angle between): area = ½ × a × b × sin C
Height to side a = 2 × area ÷ a
Median to side a = ½ × √(2b² + 2c² − a²)
Inradius = area ÷ s, circumradius = a ÷ (2 × sin A) = a × b × c ÷ (4 × area)
Worked example
Sides a = 5, b = 6 and c = 7 (the starting values). This is the SSS case: three sides.
- Check it is a triangle: the two shorter sides add to 5 + 6 = 11, which is more than 7. Yes.
- Angle A: cos A = (6² + 7² − 5²) ÷ (2 × 6 × 7) = (36 + 49 − 25) ÷ 84 = 60 ÷ 84 = 0.7143, so A = 44.42°.
- Angle B: cos B = (5² + 7² − 6²) ÷ (2 × 5 × 7) = (25 + 49 − 36) ÷ 70 = 38 ÷ 70 = 0.5429, so B = 57.12°.
- Angle C: 180° − 44.42° − 57.12° = 78.46°. (Check: cos C = (25 + 36 − 49) ÷ 60 = 12 ÷ 60 = 0.2.)
- Perimeter: 5 + 6 + 7 = 18, so s = 9.
- Area: √(9 × (9 − 5) × (9 − 6) × (9 − 7)) = √(9 × 4 × 3 × 2) = √216 = 14.6969. The other way: ½ × 5 × 6 × sin 78.46° = 15 × 0.9798 = 14.6969.
- Heights: 2 × 14.6969 ÷ 5 = 5.8788, ÷ 6 = 4.899 and ÷ 7 = 4.1991.
- Medians: ½√(72 + 98 − 25) = ½√145 = 6.0208, ½√(50 + 98 − 36) = ½√112 = 5.2915 and ½√(50 + 72 − 49) = ½√73 = 4.272.
- Inradius: 14.6969 ÷ 9 = 1.633. Circumradius: 5 × 6 × 7 ÷ (4 × 14.6969) = 210 ÷ 58.7878 = 3.5722.
- Type: the biggest angle (78.46°) is under 90° and all sides differ, so it is an acute scalene triangle.
The five cases
| You know | Case | How it is solved |
|---|---|---|
| Three sides | SSS | Law of cosines for two angles, then 180° minus them |
| Two sides and the angle between them | SAS | Law of cosines for the third side, law of sines for the smaller angle, then the angle sum |
| Two angles and the side between them | ASA | Angle sum for the third angle, then the law of sines for the other sides |
| Two angles and another side | AAS | Same as ASA |
| Two sides and an angle not between them | SSA | Law of sines for a second angle: there may be 0, 1 or 2 answers |
The ambiguous case (SSA)
Say you know sides a and b and angle A. The law of sines gives sin B = b × sin A ÷ a. If that is more than 1, side a is too short to reach and there is no triangle. If it equals 1, B is exactly 90° and there is one triangle. If it is less than 1, B could be the angle your calculator gives or 180° minus it. The second one only works if A plus it is still under 180°. For a = 6, b = 8 and A = 35°: sin B = 8 × 0.5736 ÷ 6 = 0.7648, so B = 49.89° or 130.11°. Both fit, giving c = 10.42 or c = 2.69. Tap Two answers (SSA) in Advanced to see both.
Types of triangle
- By angles: acute (all angles under 90°), right (one angle exactly 90°) or obtuse (one angle over 90°).
- By sides: equilateral (all three equal, every angle 60°), isosceles (two equal sides and two equal angles) or scalene (all different).
- Quick test: with c the longest side, c² = a² + b² is right, c² < a² + b² is acute and c² > a² + b² is obtuse.
Special right triangles and Pythagorean triples
| Triangle | Sides in the ratio | Angles |
|---|---|---|
| 45-45-90 | 1 : 1 : √2 | 45°, 45°, 90° |
| 30-60-90 | 1 : √3 : 2 | 30°, 60°, 90° |
| Pythagorean triples | 3-4-5, 5-12-13, 8-15-17, 7-24-25, 20-21-29, 9-40-41 | Whole-number sides with one 90° angle |
Builders use 3-4-5 to check a corner is square: mark 3 units along one wall and 4 along the other, and the gap between the marks should be exactly 5. Any multiple works too, such as 6-8-10.
Triangle from three points
Each side is the distance between two corners: √((x₂ − x₁)² + (y₂ − y₁)²). The area comes straight from the corners with the shoelace formula: ½ × |x_A(y_B − y_C) + x_B(y_C − y_A) + x_C(y_A − y_B)|. For (0, 0), (4, 0) and (1, 3) that is ½ × |0 + 4 × 3 + 1 × 0| = 6. If the area is 0, the points sit on one line.
Other results
- Height (altitude): the distance from a corner straight down to the opposite side (or that side extended).
- Median: the line from a corner to the middle of the opposite side. The three medians meet at the centroid, the balance point.
- Angle bisector: the line that cuts a corner’s angle in half, as far as the opposite side: 2bc × cos(A ÷ 2) ÷ (b + c).
- Inradius: the radius of the biggest circle that fits inside. Circumradius: the radius of the circle through all three corners.
- Exradius: the radius of a circle outside the triangle touching one side and the other two sides extended: area ÷ (s − a).
The calculator works in double precision and rounds only for display. Very thin triangles (an angle near 0° or 180°) are sensitive to rounding in what you type.
Common questions
How do I find the missing side of a right triangle?
Use Pythagoras: c² = a² + b², where c is the hypotenuse (the side opposite the right angle). With legs 3 and 4, c² = 9 + 16 = 25, so c = 5. To find a leg, turn it round: with hypotenuse 13 and leg 5, the other leg is √(169 − 25) = √144 = 12.
What is the law of cosines?
For any triangle, c² = a² + b² − 2ab cos C. It finds the third side from two sides and the angle between them, or an angle from three sides. With sides 5, 6 and 7, cos A = (6² + 7² − 5²) ÷ (2 × 6 × 7) = 60 ÷ 84 = 0.7143, so A = 44.42°.
Why does SSA sometimes give two triangles?
With two sides and an angle that is not between them, the law of sines gives sin B, and two angles share each sine: B and 180° − B. With a = 6, b = 8 and A = 35°, B is 49.89° or 130.11°, so side c is 10.42 or 2.69. Both triangles are real, so the calculator shows both.
How do I find the area of a triangle from three sides?
Use Heron’s formula. Work out s, half the perimeter, then area = √(s(s − a)(s − b)(s − c)). For sides 5, 6 and 7, s = 9 and the area is √(9 × 4 × 3 × 2) = √216 = 14.70. With two sides and the angle between them, area = ½ab sin C gives the same answer.
Can any three lengths make a triangle?
No. The two shorter sides must add up to more than the longest side. 1, 2 and 3 fail because 1 + 2 is not more than 3, so the sides lie flat. Three angles alone are not enough either: they fix the shape but not the size, so you need at least one side.
How can I tell if a triangle is acute, right or obtuse?
Square the longest side and compare it with the sum of the squares of the other two. Equal means a right triangle, smaller means acute, bigger means obtuse. For 5, 6 and 7, 7² = 49 and 5² + 6² = 61, so 49 is smaller and the triangle is acute: its biggest angle is 78.46°.
Related calculators
Made by Zulu Calculator, part of AlphaZulu LLC. Formulas are shown in full and rule figures are checked against official sources; see how we build calculators.