Home/Geometry/Triangle Calculator

Triangle Calculator

Solve any triangle by calculating missing sides, angles, area, perimeter and height using accurate geometry formulas including the Pythagorean theorem, law of sines, law of cosines and Heron's formula.

Quick Answer: How Do You Solve a Triangle?

A triangle is fully determined by any three independent measurements that include at least one side. Use the Pythagorean theorem (a² + b² = c²) for right triangles, the law of cosines (c² = a² + b² − 2ab·cos C) when you know all three sides or two sides and the angle between them, and the law of sines (a/sin A = b/sin B = c/sin C) when you have a side paired with its opposite angle. Area comes from ½ × base × height, ½ab·sin C, or Heron's formula when only the three sides are known.

Enter Known Values

Sides are a, b, c. Each angle sits opposite the side with the same letter — angle A is opposite side a. Enter any 3 values including at least one side, then solve. Tap a preset to load a worked example.

Solution
PropertyValue
Quick Formula Summary
Area = ½ × b × h (base & perpendicular height)
Area = ½ab·sin C (two sides, included angle)
Perimeter: P = a + b + c  |  s = P / 2
Pythagoras: a² + b² = c² (right triangles only)
Heron: Area = √( s(s−a)(s−b)(s−c) ) (three sides)
Law of sines: a / sin A = b / sin B = c / sin C
Law of cosines: c² = a² + b² − 2ab·cos C
Height: h = 2 × Area / base

What Is a Triangle?

A triangle is a closed plane figure bounded by three straight line segments. Those segments are the sides, the points where they meet are the vertices, and the amount of turn at each vertex is an interior angle. Three sides, three vertices, three angles — nothing simpler can enclose an area in flat Euclidean space, which is why the triangle sits at the base of so much mathematics, engineering and design.

Standard labelling matters more than most people expect, because every formula on this page depends on it. Vertices are named with capital letters A, B and C. Sides take the matching lower-case letter of the vertex opposite them: side a joins B to C, side b joins A to C, and side c joins A to B. Keep that pairing straight and the law of sines and law of cosines become almost mechanical. Mix it up and you get answers that look plausible but are wrong — the single most common source of error in triangle work.

Triangles are also uniquely rigid. Fix the three side lengths of a quadrilateral and you can still flex it into a different shape; fix the three sides of a triangle and the shape is locked. That property is the reason bridges, roof trusses, cranes, bicycle frames and tent poles are built from triangles rather than squares, and the reason a diagonal brace stiffens a wobbly gate.

💡 Did You Know? The triangle's rigidity is a theorem, not a coincidence. Side-Side-Side congruence says that if two triangles have three matching side lengths they are identical in every other respect — same angles, same area. No other polygon carries that guarantee.

Types of Triangles

Triangles are classified two ways at once — by the relationship between their sides and by their largest angle. Every triangle carries one label from each column. A triangle with sides 5, 5 and 7, for example, is both isosceles and acute.

By sidesDefinitionBy anglesDefinition
EquilateralAll three sides equal, so all three angles are exactly 60°AcuteAll three angles smaller than 90°
IsoscelesTwo sides equal; the two angles opposite them are equalRightOne angle exactly 90°; the side opposite it is the hypotenuse
ScaleneAll three sides different, so all three angles differ tooObtuseOne angle larger than 90°; the other two must be acute

Two consequences follow immediately. An equilateral triangle is always acute, because its angles are fixed at 60°. And a triangle can have at most one right or obtuse angle — two angles of 90° would already use the entire 180° budget, leaving nothing for the third.

Popular Triangles

A handful of triangles turn up again and again in classrooms and on job sites, because their sides or angles work out to convenient whole numbers. Enter any of them in the calculator above to see the full solution.

TriangleSidesAnglesType
3-4-53, 4, 536.87°, 53.13°, 90°Right, scalene — the builder's set-out triangle
5-12-135, 12, 1322.62°, 67.38°, 90°Right, scalene
8-15-178, 15, 1728.07°, 61.93°, 90°Right, scalene
7-24-257, 24, 2516.26°, 73.74°, 90°Right, scalene
EquilateralAll three equal60°, 60°, 60°Acute — area = (√3/4)a²
45-45-901, 1, √245°, 45°, 90°Right, isosceles — half a square
30-60-901, √3, 230°, 60°, 90°Right, scalene — half an equilateral triangle

Triangle Properties and Rules

Four rules govern every triangle in plane geometry, and they are worth knowing by heart because they let you sanity-check any calculation.

Interior and Exterior Angles

An interior angle sits inside the triangle at a vertex. Its exterior angle is the supplementary angle formed by extending one of the sides through that vertex, so interior + exterior = 180° at each corner. Because the interiors add to 180°, the three exterior angles add to 360° — the same total as walking all the way around any convex polygon.

Worked example — third angle and exterior angle

Given: A = 47°, B = 68°
Third angle: C = 180° − 47° − 68° = 65°
Exterior angle at C: 180° − 65° = 115°
Check: A + B = 47° + 68° = 115° ✓ (exterior angle theorem)

How to Solve a Triangle: Choosing the Right Method

Solving a triangle means finding all six measurements — three sides and three angles — from three known values. Which formula you reach for depends entirely on which three you were given. The five standard configurations are named for the order in which sides (S) and angles (A) appear around the triangle.

GivenMeaningMethod to useSolutions
SSSAll three sidesLaw of cosines for each angleExactly one, if the triangle inequality holds
SASTwo sides and the angle between themLaw of cosines for the third side, then finish with anglesExactly one
ASATwo angles and the side between themAngle sum, then law of sinesExactly one
AASTwo angles and a side not between themAngle sum, then law of sinesExactly one
SSATwo sides and an angle not between themLaw of sines — check the ambiguous caseZero, one or two
AAAThree angles onlyNot solvable for sizeInfinitely many similar triangles

AAA is the one combination that cannot be solved. Three angles fix the shape but say nothing about scale, so a 30-60-90 triangle the size of a postage stamp and one the size of a paddock satisfy identical data. That is why the calculator above insists on at least one side length.

Triangle Area Formulas

There are three formulas worth knowing, and the right one depends on what you have measured rather than on what kind of triangle it is.

Area = ½ × base × height (height perpendicular to the base)
Area = ½ × a × b × sin(C) (two sides and the included angle)
s = (a + b + c) / 2   →   Area = √( s(s−a)(s−b)(s−c) ) (Heron, three sides)
Area = (√3 / 4) × a² (equilateral shortcut)

1. Base and height — a garden bed

Base = 14 m, perpendicular height = 9 m
Area = ½ × 14 × 9 = 63 m²

2. Two sides and the included angle (SAS)

a = 8, b = 11, included angle C = 37°
Area = ½ × 8 × 11 × sin 37° = 44 × 0.60182 = 26.48 square units
When C = 90°, sin C = 1 and the formula collapses to ½ × base × height

3. Three sides (Heron's formula)

Sides 13, 14 and 15
s = (13 + 14 + 15) / 2 = 21
Area = √(21 × 8 × 7 × 6) = √7056 = 84 square units exactly
Pro Tip: Heron's formula doubles as a validity test. If any bracketed term comes out negative, the product under the square root is negative and no such triangle exists — the triangle inequality has failed.

Triangle Perimeter

Perimeter is the distance around the outside, so it is simply the sum of the three sides: P = a + b + c. For an equilateral triangle that shortens to P = 3a, and for an isosceles triangle with equal sides a and base b, P = 2a + b. The semi-perimeter s = P/2 appears in both Heron's formula and the inradius formula, which is why the calculator reports it.

Worked example — fencing a triangular block

Sides: 18.5 m, 24 m and 31.2 m
P = 18.5 + 24 + 31.2 = 73.7 m of fence
Order extra for corner posts and waste

Right Triangles and the Pythagorean Theorem

A right triangle contains one 90° angle. The two sides forming that angle are the legs; the side opposite it is the hypotenuse, always the longest side. Right triangles get a shortcut because you already know one angle, so two more measurements are enough to solve everything.

a² + b² = c² (c = hypotenuse)
c = √(a² + b²)  |  a = √(c² − b²)
angle = arctan(opposite / adjacent) (for the acute angles)

Worked example — legs of 9 cm and 12 cm

c = √(81 + 144) = √225 = 15 cm
A = arctan(9 / 12) = 36.87°
B = 90° − 36.87° = 53.13°

Certain whole-number side sets satisfy the theorem exactly and turn up constantly in textbooks and on building sites. They are called Pythagorean triples.

TripleCheckWhere you see it
3, 4, 59 + 16 = 25Squaring up formwork and wall frames (the 3-4-5 method)
5, 12, 1325 + 144 = 169Standard textbook exercises
8, 15, 1764 + 225 = 289Surveying and site layout
7, 24, 2549 + 576 = 625Trigonometry practice
9, 40, 4181 + 1600 = 1681Larger set-outs

Any multiple of a triple is also a triple, so 6-8-10 and 30-40-50 work just as well as 3-4-5. Builders use exactly that scaling to check a corner is square over a longer run.

💡 Did You Know? The relationship also classifies triangles. Compare c² with a² + b² where c is the longest side: equal means right-angled, smaller means acute, larger means obtuse. Sides 6, 9 and 13 give 36 + 81 = 117 against 169, so that triangle is obtuse.

Heron's Formula Explained

Heron's formula is the tool for the situation where you can measure distances but not angles — a surveyed block of land, a sail, a triangular panel. It needs nothing but the three side lengths and works for every triangle regardless of type.

Worked example — sides 7, 8 and 9

Semi-perimeter: s = (7 + 8 + 9) / 2 = 12
Area = √(12 × 5 × 4 × 3) = √720 ≈ 26.833 square units
Height to side 9 = 2 × 26.833 / 9 ≈ 5.963
⚠️ Common Mistake: Halving the perimeter is the step people skip. Using P instead of s = P/2 inflates the area badly. Always compute the semi-perimeter first, then subtract each side from it.

Law of Sines

The law of sines links each side to the sine of the angle opposite it, and all three ratios are equal. That shared ratio also equals the diameter of the triangle's circumscribed circle. Use it whenever you have a complete side-and-opposite-angle pair, which covers ASA and AAS after the angle sum gives the third angle, plus SSA.

a / sin A = b / sin B = c / sin C = 2R

Worked example (AAS) — A = 41°, B = 63°, a = 12

C = 180° − 41° − 63° = 76°
Ratio = 12 / sin 41° = 12 / 0.65606 ≈ 18.291
b = 18.291 × sin 63° ≈ 16.297
c = 18.291 × sin 76° ≈ 17.748

The Ambiguous SSA Case

SSA is the one configuration that can misbehave, because the sine function returns the same value for an angle and its supplement — sin 50° and sin 130° are identical. When the side opposite the known angle is shorter than the other given side, both the acute and the obtuse answer can produce a genuine triangle, so there are two valid solutions.

Worked example — a = 9 opposite A = 35°, and b = 12

sin B = 12 × sin 35° / 9 = 0.76477
B = 49.886° or B = 130.114° — both survive the angle-sum test
Triangle 1: C = 95.114°, c ≈ 15.629
Triangle 2: C = 14.886°, c ≈ 4.031

Two other outcomes are possible. If sin B works out greater than 1, no triangle exists at all. And if the side opposite the known angle is the longer of the two, only the acute solution survives, giving a single triangle. The calculator above detects all three outcomes and reports the second triangle whenever one exists.

Law of Cosines

The law of cosines generalises the Pythagorean theorem to triangles that are not right-angled. It appears in three interchangeable forms, one per side, and rearranges to give any angle from three known sides.

a² = b² + c² − 2bc·cos A
b² = a² + c² − 2ac·cos B
c² = a² + b² − 2ab·cos C
cos A = (b² + c² − a²) / 2bc (rearranged for an angle)

Worked example (SAS) — a = 8, b = 11, included angle C = 37°

c² = 64 + 121 − 2 × 8 × 11 × cos 37° = 185 − 140.56 = 44.44
c ≈ 6.666
cos A = (121 + 44.44 − 64) / (2 × 11 × 6.666) → A ≈ 46.237°
B = 180° − 37° − 46.237° ≈ 96.763°

Worked example (SSS) — sides 5, 7 and 9

cos A = (49 + 81 − 25) / (2 × 7 × 9) = 105 / 126 = 0.83333 → A ≈ 33.557°
B ≈ 50.704°, so C = 180° − A − B ≈ 95.739°
Obtuse, which matches 9² being greater than 5² + 7²
Pro Tip: Set C = 90° in the law of cosines and cos 90° = 0, leaving c² = a² + b². Pythagoras is just the right-angled special case, so you only ever need to remember one formula.

Triangle Height (Altitude)

Every triangle has three heights, one perpendicular to each side. Once the area is known, each height falls straight out of the base-height formula rearranged.

h = 2 × Area / base (one height per side)

Worked example — sides 10, 17 and 21

s = 24, Area = √(24 × 14 × 7 × 3) = √7056 = 84
Height to the side of 21 = 2 × 84 / 21 = 8
Height to the side of 10 = 2 × 84 / 10 = 16.8
Shorter base, taller height — the product stays constant

Two special cases are worth remembering. In a right triangle each leg is already the height for the other leg as the base. And in an obtuse triangle, the heights to the two shorter sides land outside the triangle, which is perfectly valid even though it looks odd sketched on paper.

Inradius, Circumradius and Triangle Centres

The calculator also reports two radii that come up in engineering and competition geometry. The inradius r = Area / s is the radius of the largest circle that fits inside the triangle, touching all three sides. The circumradius R = abc / (4 × Area) is the radius of the circle through all three vertices.

Worked example — the 7-8-9 triangle

Area ≈ 26.833 and s = 12
r = 26.833 / 12 ≈ 2.236
R = (7 × 8 × 9) / (4 × 26.833) ≈ 4.696

For an equilateral triangle of side a these simplify neatly: r = a / (2√3) and R = a / √3, so the circumradius is always exactly twice the inradius. Related centres include the centroid, where the three medians meet and a uniform triangular plate balances, and the orthocentre, where the three altitudes meet.

Common Geometry Problems Worked Through

Finding the missing side of a right triangle

A ladder reaches 5.6 m up a wall with its base 2.1 m out. The ladder is the hypotenuse: c = √(5.6² + 2.1²) = √35.77 ≈ 5.98 m. Its angle to the ground is arctan(5.6 / 2.1) ≈ 69.4°.

Isosceles triangle from an apex angle

An isosceles triangle has an apex angle of 40°, so the two base angles share what is left: (180° − 40°) / 2 = 70° each. If the equal sides are 13 cm and the base is 10 cm, the height splits the base in half, giving h = √(13² − 5²) = √144 = 12 cm and an area of ½ × 10 × 12 = 60 cm².

Area of an equilateral triangle

Use Area = (√3 / 4) × a². For a = 10, that is 0.43301 × 100 = 43.301 square units. Heron's formula gives the same answer with more arithmetic.

Roof pitch on site

A roof with a 22.5° pitch spans a half-width (run) of 4.2 m. The rise is 4.2 × tan 22.5° ≈ 1.74 m and the rafter length is 4.2 / cos 22.5° ≈ 4.546 m before any overhang. Enter b = 4.2, A = 22.5 and B = 90 in the calculator above to reproduce it.

Practical Uses of Triangles

Common Calculation Mistakes

MistakeWhy it goes wrongHow to avoid it
Pairing the wrong side with an angleThe law of sines needs a side and the angle opposite it, not an adjacent oneConfirm side a faces angle A before substituting
Using Pythagoras on a non-right trianglea² + b² = c² only holds when one angle is exactly 90°Switch to the law of cosines for every other triangle
Calculator left in radian modesin 30° = 0.5, but sin 30 radians = −0.988Check the DEG indicator; this calculator always uses degrees
Missing the second SSA triangleArcsine only ever returns the acute answerWhen the side opposite the known angle is shorter, test 180° − B too
Using a slanted side as the heightThe height must be perpendicular to the chosen baseUse ½ab·sin C or Heron's formula instead of guessing a height
Forgetting to halve the perimeterHeron's formula needs s = P/2, not PWrite s down as a separate step every time
Rounding partway throughEarly rounding compounds through later stepsKeep full precision until the final answer, then round once
Mixing unitsMetres and centimetres in the same triangleConvert everything to one unit first

Triangle Formula Cheat Sheet

Quick Reference

Angle sum: A + B + C = 180°
Triangle inequality: a + b > c for every pairing
Perimeter: P = a + b + c  |  Semi-perimeter: s = P / 2
Area (base & height): ½ × b × h
Area (SAS): ½ab·sin C
Area (SSS, Heron): √(s(s−a)(s−b)(s−c))
Area (equilateral): (√3 / 4)a²
Height: h = 2 × Area / base
Pythagoras: a² + b² = c²
Law of sines: a/sin A = b/sin B = c/sin C
Law of cosines: c² = a² + b² − 2ab·cos C
Angle from three sides: cos C = (a² + b² − c²) / 2ab
Inradius: r = Area / s  |  Circumradius: R = abc / (4 × Area)

Practice Questions

Beginner (with answers)

  1. Two angles of a triangle are 47° and 68°. What is the third angle?
  2. A triangle has a base of 14 cm and a perpendicular height of 9 cm. Find its area.
  3. What is the perimeter of an equilateral triangle with sides of 6.5 m?
  4. A right triangle has legs of 9 and 12. How long is the hypotenuse?
  5. An isosceles triangle has an apex angle of 40°. Find the two base angles.
Show answers

1) 180° − 47° − 68° = 65°   2) ½ × 14 × 9 = 63 cm²   3) 3 × 6.5 = 19.5 m   4) √(81 + 144) = 15   5) (180° − 40°) / 2 = 70° each

Advanced (with answers)

  1. Find the area of a triangle with sides 13, 14 and 15.
  2. Given a = 9, b = 12 and the included angle C = 58°, find side c and the area.
  3. A triangle has sides 6, 9 and 13. Find its largest angle and classify it.
  4. Given a = 8 opposite A = 36°, and b = 11, how many triangles are possible?
  5. A triangle has sides 10, 17 and 21. Find the height to the side of length 21.
Show answers

1) s = 21, Area = √(21 × 8 × 7 × 6) = 84 square units   2) c² = 81 + 144 − 216·cos 58° = 110.54, so c ≈ 10.514; Area = ½ × 9 × 12 × sin 58° ≈ 45.795   3) cos = (36 + 81 − 169) / 108 = −0.48148 → 118.782°, scalene and obtuse   4) sin B = 11 × sin 36° / 8 = 0.80820 → B = 53.921° or 126.079°; since a < b and both angle sums stay under 180°, two triangles exist   5) s = 24, Area = 84, height = 2 × 84 / 21 = 8

🔑 Key Takeaways

Frequently Asked Questions

How do you calculate a triangle?

Start with what you know. If you have all three sides, use the law of cosines to find the angles. If you have two sides and the angle between them, use the law of cosines to find the third side. If you have two angles and any side, subtract from 180° for the third angle and use the law of sines for the remaining sides. Once every side and angle is known, the perimeter is a + b + c and the area comes from Heron's formula or ½ab·sin C.

How do you find the missing side of a triangle?

In a right triangle, rearrange the Pythagorean theorem: c = √(a² + b²) for the hypotenuse, or a = √(c² − b²) for a leg. In any other triangle, use the law of cosines if you know the other two sides and the angle between them, or the law of sines if you already have a side paired with its opposite angle.

How do you calculate triangle area?

Three formulas cover every situation. With a base and its perpendicular height, Area = ½ × base × height. With two sides and the angle between them, Area = ½ab·sin C. With all three sides, use Heron's formula: s = (a+b+c)/2, then Area = √(s(s−a)(s−b)(s−c)). For an equilateral triangle there is a shortcut: Area = (√3/4)a².

What is Heron's formula?

Heron's formula finds the area of any triangle from its three side lengths alone, with no angles or heights needed. First calculate the semi-perimeter s = (a+b+c)/2, then Area = √(s(s−a)(s−b)(s−c)). For sides 7, 8 and 9: s = 12, so Area = √(12 × 5 × 4 × 3) = √720 ≈ 26.833 square units. It is the standard method for surveyed land and any triangle where only distances were measured.

How do you find triangle angles?

If you know two angles, the third is 180° minus their sum. If you know all three sides, use the rearranged law of cosines: cos A = (b² + c² − a²) / 2bc, then take the inverse cosine. If you have a side paired with its opposite angle plus one more side, use the law of sines — but remember that arcsine returns only the acute answer, so check whether an obtuse solution also fits.

What is the Pythagorean theorem?

For a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides: a² + b² = c², where c is the side opposite the 90° angle. It applies only to right triangles. Comparing c² with a² + b² also classifies any triangle: equal means right-angled, smaller means acute, larger means obtuse.

What is the law of cosines?

The law of cosines states c² = a² + b² − 2ab·cos C, relating all three sides to one angle. Use it when you know two sides and the angle between them (SAS) or all three sides (SSS). It works for every triangle, and because cos 90° = 0 it reduces exactly to the Pythagorean theorem when one angle is a right angle.

What is the law of sines?

The law of sines states a/sin A = b/sin B = c/sin C — each side divided by the sine of its opposite angle gives the same ratio, which equals the diameter of the circumscribed circle. Use it for two angles and a side (ASA or AAS), or two sides and a non-included angle (SSA, where two triangles may be possible).

How do you solve a right triangle?

You already know one angle is 90°, so two more values are enough. Given both legs, find the hypotenuse with Pythagoras and the angles with arctan(opposite/adjacent). Given one leg and the hypotenuse, find the other leg with Pythagoras and the angles with arcsine or arccosine. Given one side and one acute angle, use sine, cosine or tangent, and the remaining acute angle is 90° minus the known one.

How do you calculate triangle perimeter?

Add the three sides: P = a + b + c. For an equilateral triangle P = 3a, and for an isosceles triangle with equal sides a and base b, P = 2a + b. If a side is missing, solve for it first with Pythagoras or the law of cosines, then add.

Can a triangle have two right angles?

No. Two right angles already account for the full 180° that the interior angles must total, leaving nothing for the third angle — the two lines would be parallel and never meet. For the same reason a triangle can never have two obtuse angles, or one right angle plus one obtuse angle. At most one angle can be 90° or more.

What are the types of triangles?

By sides: equilateral (all three equal, all angles 60°), isosceles (two equal, with equal base angles) and scalene (all different). By angles: acute (all under 90°), right (one exactly 90°) and obtuse (one over 90°). Every triangle carries one label from each group — for example 5, 5, 7 is isosceles and acute.

What is the ambiguous SSA case?

When you know two sides and an angle that is not between them, two different triangles can satisfy the data, because sin θ and sin(180° − θ) are equal. If the side opposite the known angle is shorter than the other given side, check both the acute and obtuse solutions. If the sine calculation exceeds 1, no triangle exists. The calculator on this page flags a second solution whenever one is possible.

How do you find the height of a triangle?

Rearrange the area formula: h = 2 × Area / base. Find the area first — Heron's formula works from three sides — then divide. Every triangle has three heights, one perpendicular to each side, so a shorter base always pairs with a taller height. In a right triangle, each leg is already the height for the other leg.

Why can't a triangle be solved from three angles alone?

Three angles fix the shape but not the size. A 30-60-90 triangle a centimetre across and one a kilometre across have identical angles, so infinitely many similar triangles fit the same data. At least one side length is required to set the scale, which is why this calculator asks for one.

What units does this triangle calculator use?

The calculator is unit-agnostic for lengths: enter millimetres, centimetres, metres or inches and the sides, perimeter and heights come back in the same unit, with areas in that unit squared. The only requirement is consistency — never mix metres and centimetres in one triangle. Angles are always in degrees, not radians.

References

Last updated: July 2026
Reviewed by Mohsin Iqbal using standard Euclidean geometry and trigonometry, with every worked example independently verified. This page is for educational purposes.