Formula

Perimeter of a rectangle

Also written: perimeter formula · 2l + 2w · distance around a rectangle

P=2l+2wP = 2l + 2w

The perimeter of a rectangle is twice its length plus twice its width, because opposite sides are equal. For any other shape, add every side.

What each part means

ll
the length
ww
the width

Perimeter of a rectangle calculator

Enter the length and width to find the distance around with P=2l+2wP = 2l + 2w. The steps add all four sides first, then group the equal ones.

The steps below find the perimeter of a rectangle 8 by 5, using P=2l+2wP = 2l + 2w. Turn on JavaScript to try your own measurements.

Worked example: l=8,w=5

The perimeter is 26.

A rectangle 8 by 5 Shows a rectangle with its length 8 labeled along the bottom and its width 5 labeled up the left side. l = 8 w = 5
A rectangle 8 by 5

Add the four sides

The picture shows a rectangle 8 long and 5 wide. Opposite sides are equal, so the four sides, going round, are the length, the width, the length and the width.

8+5+8+5=26

The shortcut: group the equal sides

P=2l+2w=2(8)+2(5)=16+10=26

This is the same addition, grouped. Doubling the length and the width is quicker than adding four numbers.

Write the units

Perimeter is a distance around the outside, so it is never written in square units.

Runs on your device: nothing you type is sent or saved. Want the reasoning behind the shortcut? Read the perimeter lesson, or find the space inside with the area formula.

When to use it

You need the distance around a shape — fencing, framing, edging, trim. For shapes that are not rectangles, add the sides instead.

The general rule is simpler than the formula

For any shape with straight sides, the perimeter is the sum of the sides. That is the definition, and it never fails.

8+5+8+5=268 + 5 + 8 + 5 = 26

The rectangle formula is that addition grouped, nothing more:

8+8⏟2l+5+5⏟2w=2l+2w\underbrace{8 + 8}_{2l} + \underbrace{5 + 5}_{2w} = 2l + 2w

A square has four equal sides, so P=4sP = 4s for the same reason.

Units are never squared

Perimeter is a distance, so it is measured in cm or m. A perimeter given in cm² has been confused with an area, and the units alone reveal it.

Perimeter tells you almost nothing about area

The two vary independently, which surprises people.

RectanglePerimeterArea
1×111 \times 1124241111
4×84 \times 824243232
6×66 \times 624243636

Same fence, triple the field. For a fixed perimeter the area is largest when the shape is squarest — which is why fields, rooms and packaging tend toward square.

Rearranged

l=P−2w2w=P−2l2l = \frac{P - 2w}{2} \qquad w = \frac{P - 2l}{2}

In practice: subtract the pair you know from the perimeter, then halve what is left. A perimeter of 3030 with a length of 99 leaves 30−18=1230 - 18 = 12 for two widths, so each is 66.

Read the question first

“Perimeter” and “how much fencing” are usually the same number — but not when a side is left open for a gate or a wall. See perimeter.

Lessons that teach this

Related