Perimeter of a Triangle Calculator
Choose which three measurements you know, enter them with their units, and the calculator works out the missing sides and returns the perimeter. The guide explains each rule with a checked example.
Related calculators
Created by the Reeliy Editorial Team. Last updated: Oct 19, 2026
Perimeter of a triangle formula
The perimeter of a triangle is the length of its three sides added together:
P = a + b + c
Special cases are quicker. An equilateral triangle with side a has P = 3a, an isosceles triangle with two equal sides a and a base b has P = 2a + b, and a right triangle with legs p and q has P = p + q + √(p² + q²).
Three lengths only make a triangle when each one is shorter than the sum of the other two. In SSS mode the calculator adds whatever you type without testing this, so check it yourself: sides of 1, 2 and 10 produce a total of 13 but no real triangle.
Rules for solving a triangle
When you do not know all three sides, the calculator first finds the missing ones from the data you choose in Solve triangle by. Sides are named a, b and c, and the angles α, β and γ sit opposite them.
| Rule | You enter | Missing sides come from |
|---|---|---|
| SSS | Sides a, b, c | Nothing to solve: add the sides |
| SAS | Sides b and c and the angle α between them | Law of cosines |
| SSA | Sides b and c and the angle β opposite b | Law of sines (may give two triangles) |
| ASA | Angles α and β and the side c between them | Third angle, then law of sines |
| AAS | Angles α and γ and side c, opposite γ | Third angle, then law of sines |
| HL | Leg b and hypotenuse c of a right triangle | Pythagorean theorem |
SAS: a = √(b² + c² − 2bc·cos α)Law of cosines. Then P = a + b + c.
ASA / AAS: a = c·sin α ÷ sin γ and b = c·sin β ÷ sin γLaw of sines, after finding the missing angle from α + β + γ = 180°.
HL: a = √(c² − b²)Here c is the hypotenuse and b is a leg.
For more on sines and cosines, see the trigonometry calculator.
How to use the calculator
- Pick the rule that matches what you know in Solve triangle by. Only the fields that rule needs are shown.
- Choose Metric, the unit in which you want the perimeter.
- Enter the lengths and angles. Every side has its own unit select, so one side can be in centimetres and another in metres.
- Press Calculate. The result is printed with the unit and its full name, for example 12 cm (centimeters).
Metric only sets the unit of the answer. Set the unit next to each side yourself; they all start at cm. Blank fields count as zero. Angles run from 0 to 360 degrees and lengths cannot be negative.
Examples: find the perimeter of a triangle
SSS. Sides of 3, 4 and 5 cm give P = 3 + 4 + 5 = 12 cm. With mixed units the calculator converts first: 3 cm, 0.04 m and 50 mm total 120 mm, which is 4.724409 in when Metric is set to inches.
SAS. Sides b = 5 and c = 7 enclose an angle α = 60°. Then a = √(25 + 49 − 2·5·7·cos 60°) = √(74 − 35) = √39 ≈ 6.244998, and P = 6.244998 + 5 + 7 = 18.244998.
ASA. Side c = 10 lies between α = 40° and β = 60°. The third angle is γ = 180° − 40° − 60° = 80°. Then a = 10·sin 40° ÷ sin 80° ≈ 6.527036 and b = 10·sin 60° ÷ sin 80° ≈ 8.793852, so P ≈ 25.320889.
AAS. Side c = 10 is opposite γ = 60°, with α = 40°. The remaining angle is β = 80°. Then a = 10·sin 40° ÷ sin 60° ≈ 7.422272 and b = 10·sin 80° ÷ sin 60° ≈ 11.371580, so P ≈ 28.793852.
HL. A right triangle with leg 3 and hypotenuse 5 has a second leg of √(25 − 9) = 4, so P = 3 + 4 + 5 = 12.
The SSA case can have two answers
Knowing two sides and an angle that is not between them can describe two different triangles. Take b = 5, c = 7 and β = 30°. The law of sines gives sin γ = 7·sin 30° ÷ 5 = 0.7, and γ can be 44.427004° or its supplement 135.572996°.
| Triangle | γ | α | Side a | Perimeter |
|---|---|---|---|---|
| First | 44.427004° | 105.572996° | 9.632892 | 21.632892 |
| Second | 135.572996° | 14.427004° | 2.491464 | 14.491464 |
When the known side opposite the angle is the longer one (b = 7 and c = 5 with the same 30°), only one triangle fits and a single perimeter, 22.868475, is shown. If the sides are too short to reach, for instance b = 2 and c = 7 with β = 30°, the calculator answers Such a triangle cannot exist!
When no triangle exists
- SSA: the side opposite the angle is too short for the other side to meet it.
- ASA and AAS: the two angles add up to 180° or more, leaving nothing for the third angle.
- HL: the hypotenuse is shorter than the leg.
In each of these cases the calculator shows the message above instead of a number. To find the perimeter of other shapes, try the perimeter calculator, the perimeter of a rectangle calculator, the perimeter of a square calculator or the area of a triangle calculator.
Frequently asked questions
How do you find the perimeter of a triangle?
Add the lengths of its three sides. If a side is missing, find it from the information you have: the law of cosines for SAS, the law of sines for ASA, AAS and SSA, or the Pythagorean theorem for a right triangle.
What does SSA mean and why can it give two perimeters?
SSA means two sides and an angle that is not between them. Depending on the numbers, that data can fit one triangle, two triangles or none, which is why the calculator may show a second possible perimeter.
Can I enter the sides in different units?
Yes. Each side has its own unit select, and the calculator converts everything before adding. Choose the unit of the answer in Metric.
What does "Such a triangle cannot exist" mean?
The numbers you entered cannot form a triangle, for example two angles that add up to 180 degrees or more, or a hypotenuse shorter than a leg.
Cite this calculator and page
If you use this page in your work, you can cite it as:
Reeliy Editorial Team. (2026). Perimeter of a Triangle Calculator. Reeliy. https://reeliy.com/calculators/perimeter-of-triangle-calculator“Perimeter of a Triangle Calculator.” Reeliy, 2026, https://reeliy.com/calculators/perimeter-of-triangle-calculator.