Written by Erum Nazeer Built by Muhammad Ayaz Akhtar Updated

Maths calculator

Triangle Calculator

Enter any three values that define a triangle, sides, angles, or a mix of both, and get all missing sides, all missing angles, area, perimeter, and height with full working steps. Works for right triangles, isosceles triangles, equilateral triangles, and any scalene triangle from SSS, SAS, ASA, AAS, or SSA inputs.

A + B + C = 180°

Triangle solver

Enter any valid 3 values

b a c C A B
Tip: Enter at least one side and enough total information to define the triangle.

On This Page

What You Can Enter

Give the calculator any three values, with at least one side, and it works out the rest: the missing sides, all three angles, area, perimeter and height. It picks the method from which fields you filled in:

You knowNameHow it solves
All three sidesSSSLaw of Cosines for the angles: cos(C) = (a² + b² − c²) ÷ 2ab
Two sides and the angle between themSASLaw of Cosines for the third side, then the angles
Two angles and a sideASA / AASThird angle = 180° − the other two; Law of Sines scales the sides
Two sides and an angle not between themSSALaw of Sines; can match two triangles, so the result is flagged

Three angles alone (AAA) fix the shape but not the size, so you always need one side.

The Two Rules Every Triangle Obeys

A triangle has three sides, three vertices and three angles, and two rules decide whether your numbers can form one. The angles always add up to 180° (π radians). The triangle inequality says any two sides must add up to more than the third, so 2, 3 and 8 cannot close. If the calculator says a triangle is invalid, one of these two rules has failed.

Right Triangles

Enter 90 for one angle plus any two other values. The hypotenuse is the longest side, opposite the right angle.

Right triangle diagram with legs a and b and hypotenuse c labeled, showing the Pythagorean theorem a² + b² = c²
Right triangle with legs a and b and hypotenuse c labeled, showing the Pythagorean theorem a² + b² = c²
c = √(a² + b²)    a = √(c² − b²)
sin = opposite ÷ hypotenuse   cos = adjacent ÷ hypotenuse   tan = opposite ÷ adjacent

Pythagoras also gives the distance between two points: the line from (x1, y1) to (x2, y2) is the hypotenuse of the triangle those points make. The same rule gives a screen's diagonal, while the Aspect Ratio Calculator keeps width and height in proportion. The tangent ratio, rise over run, is the slope of a line, which the Slope Calculator finds from two points, and positive vs negative slope explains how to read its sign.

30-60-90 and 45-45-90 Shortcuts

Special right triangles reference table showing 30-60-90 (1:√3:2), 45-45-90 (1:1:√2), and Pythagorean triples 3-4-5, 5-12-13, 8-15-17
Special right triangles: 30-60-90 (1:√3:2), 45-45-90 (1:1:√2), and Pythagorean triples 3-4-5, 5-12-13, 8-15-17

These fixed shapes have fixed side ratios. In a 30-60-90 triangle, if the short leg is x, the long leg is x√3 and the hypotenuse is 2x. In a 45-45-90 triangle, both legs are x and the hypotenuse is x√2. To solve either, enter all three angles and any one side.

Area Three Ways, Plus Height

The height (altitude) from any base is 2 × area ÷ base. In a right triangle each leg is the height for the other, and the height to the hypotenuse is (a × b) ÷ c. For a 3-4-5 triangle that is 2.4.

Isosceles and Equilateral Triangles

For an isosceles triangle, enter the two equal sides as a and b and the base as c. The base angles are equal: A = B = (180° − C) ÷ 2. With equal sides s and base b, area = ¼ × b × √(4s² − b²).

An equilateral triangle has three equal sides and three 60° angles. Area = s²√3 ÷ 4, height = s√3 ÷ 2 and perimeter = 3s. With 10 cm sides, that is about 43.30 cm² of area and 8.66 cm of height.

Four Triangles, Solved

GivenMethodResult
Sides 5, 6, 7SSSAngles 44.42°, 57.12°, 78.46°; perimeter 18; area √216 ≈ 14.70
Sides 10 and 14, 38° between themSAS: c² = a² + b² − 2ab cos CThird side 8.68; angles 45.17° and 96.83°; area 43.10
Angles 42° and 63°, side c = 12ASA: C = 75°, then Law of Sinesa = 8.31, b = 11.07; area 44.44; perimeter 31.38
Ladder 6 ft from a wall, reaching 8 ft upRight triangleLadder length √(36 + 64) = 10 ft

How the Solver Is Verified

Which formula runs depends on exactly which six fields have values: three known sides trigger the Law of Cosines (SSS), two sides plus their included angle trigger the Law of Cosines the other direction (SAS), two angles plus any side trigger the angle-sum rule (ASA/AAS), and two sides with a non-included angle trigger the Law of Sines in a loop that also flags the SSA case as possibly ambiguous in its output note. Once all three sides are resolved, whichever method produced them, the code recomputes A, B, and C directly from those sides with the Law of Cosines and separately checks that the angles still sum to pi radians and that the sides pass the triangle inequality test, throwing a specific error message for each failure. Area always comes from Heron's formula applied to the final three side lengths, so a triangle solved from two angles and one side gets the same area calculation as one entered as three raw side lengths.

Frequently Asked Questions

How do you calculate the angles of a right triangle?

If both legs are known: angle A = arctan(a ÷ b). If one leg and the hypotenuse are known, use arcsin or arccos. For example, a = 3, c = 5: angle A = arcsin(3/5) ≈ 36.87°.

How many values are needed to solve a triangle?

Three, with at least one being a side length. Three angles alone (AAA) define the shape but not the size, side lengths, area, and perimeter cannot be found without at least one known side.

Why is my triangle invalid?

Three common causes: a side length equals or exceeds the sum of the other two (triangle inequality), the angles do not sum to 180°, or in an SSA case the given side is too short to reach the opposite base.

References