Perimeter Calculator with Steps

Pick a shape and enter its side lengths to find the perimeter — the total distance around the outside. The formula, the working and a labelled diagram are shown for every shape, including any polygon from a list of sides.

Grades 3–8FreeNo sign-up

How to use the perimeter calculator

  1. Choose the shape. For an irregular shape, pick Any polygon and type every side length separated by commas, for example 5, 7, 4, 6, 3.
  2. Enter the side lengths. Decimals are fine. Choose a unit if your problem has one — make sure every side uses the same unit.
  3. Read the perimeter, the formula and the steps. The diagram labels each side so you can check nothing was missed.

What is perimeter?

The perimeter of a shape is the total length of its boundary — how far you would walk if you went once all the way around the edge. The word comes from Greek: peri (around) and metron (measure). Perimeter is a length, so it is measured in ordinary units such as cm, m, in or ft, never in square units.

For any shape with straight sides the rule is always the same: add up all the sides. The formulas below are just shortcuts for shapes where some sides are equal.

Perimeter formulas

ShapeFormulaWhy
RectangleP = 2 × (l + w)two lengths and two widths
SquareP = 4 × sfour equal sides
TriangleP = a + b + cthree sides
CircleC = 2 × π × rthe circumference
ParallelogramP = 2 × (a + b)opposite sides are equal
TrapezoidP = a + b + c + dfour different sides
Regular polygonP = n × sn equal sides
Any polygonP = sum of all sidesthe definition

Worked examples

Rectangle. A garden is 8 m long and 5 m wide. How much fencing goes around it?
P = 2 × (8 + 5) = 2 × 13 = 26 m.

Regular hexagon. Each side is 4 cm.
P = 6 × 4 = 24 cm.

Irregular pentagon. The sides are 5, 7, 4, 6 and 3 ft.
P = 5 + 7 + 4 + 6 + 3 = 25 ft.

Circle. The radius is 5 in.
C = 2 × π × 5 = 10π ≈ 31.4159 in.

Can these sides really make a shape?

Not every set of lengths closes up into a shape. For a triangle, the longest side must be shorter than the other two put together — the triangle inequality. Sides 2, 3 and 10 cannot make a triangle, because the two short sides cannot reach each other across a gap of 10. The same idea applies to every polygon: the longest side must be shorter than the sum of all the others. The calculator checks this and warns you if your numbers describe an impossible shape, which usually means a typing mistake or a misread diagram.

Finding a missing side first

Many homework problems hide one of the sides:

Perimeter and area are different things

Perimeter is the distance around a shape; area is the space inside it. Fencing, picture frames, ribbon around a cake and skirting boards are perimeter problems. Carpet, paint, grass seed and tiles are area problems — use the area calculator for those. Two shapes can have the same perimeter and very different areas: a 1 × 9 rectangle and a 5 × 5 square both have perimeter 20, but their areas are 9 and 25.

Frequently asked questions

How do I find the perimeter of a rectangle?

Add the length and the width, then double the result: P = 2 × (l + w). A rectangle 8 by 5 has perimeter 2 × 13 = 26.

How do I find the perimeter of a triangle?

Add the three side lengths: P = a + b + c. A triangle with sides 5, 6 and 7 has a perimeter of 18.

What is the perimeter of a circle called?

It is called the circumference. Use C = 2πr with the radius or C = πd with the diameter. A circle of radius 5 has circumference 10π ≈ 31.42.

How do I find the perimeter of an irregular shape?

Measure every side and add the lengths together. Choose “Any polygon” in the calculator and type the sides separated by commas.

What is the difference between perimeter and area?

Perimeter is the distance around a shape, measured in units such as cm. Area is the surface inside the shape, measured in square units such as cm².

How do I find a side length from the perimeter?

Reverse the formula. For a square, divide the perimeter by 4. For a rectangle, halve the perimeter and subtract the side you know: a perimeter of 30 with length 9 gives a width of 15 − 9 = 6.