The formula for perimeter is the sum of all the side lengths. Every other perimeter formula on this page is a shortcut for that one rule.
Perimeter is the total distance around the outside of a two-dimensional shape. Walk the boundary, measure how far you went, and that is the perimeter.
The general formula
Perimeter = the sum of the lengths of all sides
For any polygon, add every side. A shape with sides of 3, 4, 5 and 6 units has a perimeter of 18 units, and that holds whether the shape is regular, irregular, convex or concave.
The named formulas below exist because repeated sides let you multiply instead of adding. They are not different rules.
Perimeter formulas by shape
| Shape | Formula | What the letters mean |
|---|---|---|
| Square | P = 4a | a is the side length |
| Rectangle | P = 2a + 2b, or 2(a + b) | a is length, b is width |
| Triangle | P = a + b + c | the three side lengths |
| Regular polygon | P = n × a | n is the number of sides, a is one side |
| Circle | C = 2πr, or πd | r is radius, d is diameter |
The circle formula is the one exception to the add-the-sides rule, because a circle has no sides. Its perimeter has its own name: circumference.
Square

All four sides of a square are equal, so a + a + a + a becomes 4a.
Worked example. A square with sides of 7 cm has a perimeter of 4 × 7 = 28 cm.
Rectangle

A rectangle has two pairs of equal sides, so the perimeter is 2a + 2b. Writing it as 2(a + b) is the same thing and is usually faster to compute.
Worked example. A rectangle 9 cm long and 4 cm wide has a perimeter of 2(9 + 4) = 26 cm.
Triangle

A triangle has no repeated sides in the general case, so there is no shortcut. Add all three.
Worked example. A triangle with sides 5, 12 and 13 cm has a perimeter of 30 cm.
An equilateral triangle is the special case where all three are equal, giving P = 3a.
Circle

The ratio of a circle’s circumference to its diameter is the constant π. That relationship gives two equivalent formulas.
C = 2πr where r is the radius, or C = πd where d is the diameter.
Both work because the diameter is twice the radius. Use whichever measurement you were given.
π to two decimal places is 3.14. To four decimal places it is 3.1416. It is an irrational number, so any decimal you write down is an approximation.
Worked example. A circle with a radius of 5 cm has a circumference of 2 × 3.14 × 5 = 31.4 cm.
The mistake to watch for
The confusion: Students routinely swap perimeter and area, or use a radius where the formula wants a diameter.
Why it happens: Both perimeter and area are described as “how big” the shape is, and both circle formulas look alike.
The distinction: Perimeter is a length, measured in cm, m or inches. Area is a surface, measured in square units such as cm². If your answer for perimeter has a squared unit, something went wrong.
The check: Read what you were given before choosing the circle formula. Radius goes with 2πr. Diameter goes with πd. Using the diameter in the radius formula doubles your answer.
What this page does not cover
Perimeter applies to two-dimensional shapes only. Three-dimensional solids have surface area and volume instead. Curved shapes other than circles, such as ellipses, need methods beyond these formulas.
Where to go next
For the space inside the boundary rather than the boundary itself, see area formulas. For solids, see surface area formulas. Shape names and properties are in polygon properties, and the section index is in geometry.