Perimeter
P = a + b + c
The sum of the three sides.
Calculate the perimeter of a triangle from its three sides, or from two sides and the angle between them using the law of cosines. Triangle inequality check, worked examples and different units accepted for each side.
Perimeter
This calculator gives the perimeter of a triangle, the sum of its three sides. If you only know two sides and the angle between them, it first finds the third side with the law of cosines. Use it for geometry exercises, but also to fence a triangular plot, edge a pointed flower bed or work out the length of lumber in a roof truss.
Three sides: P = a + b + c. Before adding, the tool checks the triangle inequality: each side must be strictly shorter than the sum of the other two. Lengths of 2, 3 and 6 cm cannot close into a triangle; in that case no result is shown rather than a misleading perimeter.
Two sides and the included angle: the third side comes from the law of cosines, c² = a² + b² − 2ab cos C. The perimeter is then a + b + c. With a 90° angle, cos C = 0 and the formula reduces to the Pythagorean theorem.
Each length can be entered in its own unit; the values are harmonized before the calculation and the result follows the unit of the first field. The angle can be given in degrees, radians or gradians and must be strictly between 0 and 180°.
Perimeter is a length, not an area. Two triangles with the same perimeter can have very different areas: for a given length of fencing, the equilateral triangle encloses the most area.
Three sides if you know them all, otherwise Two sides + included angle.
Lengths with their units, angle in degrees, radians or gradians.
It appears as soon as the data form a valid triangle and updates as you type.
The perimeter is a sum; the law of cosines supplies the missing side.
P = a + b + c
The sum of the three sides.
c² = a² + b² − 2ab cos C
The third side from two sides and the included angle.
c < a + b
The condition for the triangle to exist, checked against the longest side.
Example: a = 4, b = 6, c = 7 cm, P = 17 cm.
Check a perimeter, test the triangle inequality or apply the law of cosines from high school trigonometry.
Work out the fencing or edging for a triangular plot or flower bed.
Get the total length of lumber for a triangular roof truss or frame.
Find an inaccessible side from two distances and the angle measured between them.
5 + 7 + 9 = 21 cm; 9 < 5 + 7, so the triangle exists.
Input
a = 5, b = 7, c = 9 cmResult
P = 21 cm3 × 6 = 18 cm.
Input
three sides of 6 cmResult
P = 18 cmc² = 25 + 49 − 2 × 5 × 7 × 0.5 = 39, so c ≈ 6.24 m and P ≈ 5 + 7 + 6.24 = 18.24 m.
Input
a = 5 m, b = 7 m, C = 60°Result
P ≈ 18.24 mThe law of cosines gives c = 5 m, just like Pythagoras: 3 + 4 + 5 = 12 m.
Input
a = 3 m, b = 4 m, C = 90°Result
P = 12 m120 m of fencing, minus the width of the gate.
Input
sides of 30, 40 and 50 mResult
P = 120 m6 > 2 + 3: the sides cannot meet.
Input
a = 2, b = 3, c = 6 cmResult
no resultP = a + b + c: the sum of the lengths of the three sides, expressed in the same unit.
You need one more piece of information. With the angle between those sides, the law of cosines gives the third: c² = a² + b² − 2ab cos C. For a right triangle where you know both legs, the Pythagorean theorem is enough.
In any triangle, each side is strictly shorter than the sum of the other two. If the longest side equals the sum of the other two, the points are collinear; if it is longer, the triangle cannot close.
Equilateral: P = 3 × a. Isosceles with equal sides a and base b: P = 2a + b.
Not on its own: you need all three sides. Heron's formula actually uses the semi-perimeter s = P ÷ 2 to calculate the area.
Related tools
Tools similar or complementary to this one.
Find the area of a triangle from the base and height, all three sides (Heron's formula) or two sides and the included angle.
Find the hypotenuse or a missing leg of a right triangle, or check whether a triangle is right-angled with the converse, with a full worked solution.
Find a missing length with the intercept theorem, also called the basic proportionality or side splitter theorem, or test parallel lines with its converse.
Learn how to calculate areas, perimeters, diagonals, angles, surfaces and volumes, and open the Bethemesh geometry calculator directly on the shape you need.