Formula for Perimeter: Rectangle, Square, Triangle and Polygon Calculator

Rectangle perimeter

P = 2 × (l + w)

Length l · Width w

l = 8w = 5l = 8w = 5P = 26

Follow every outside edge once, excluding internal lines.

P = 2 × (l + w)

Diagram not to scale; labelled measurements determine the perimeter. Moving the sides illustrates adding boundary lengths.

Worked example you can change

Perimeter = 2 × (length + width)

Editable worked example
Perimeter = 2 × ( + )
  1. Perimeter ≈ 26 units

Calculator

Enter complete decimal numbers using one common unit for dimensions; changing the unit label does not convert numbers. Decimal answers are shown to 15 significant digits.

Calculator inputs
Perimeter
26 cm

Formula variants

Related formulas and when to use them
Shape or methodFormulaMeaning
RectangleP = 2(l + w)Opposite sides are equal. Add two lengths and two widths.
SquareP = 4sAll four sides have the same length.
TriangleP = a + b + cAdd the three side lengths. They must form a non-degenerate triangle.
Regular polygonP = nsMultiply 3 to 1000000 equal sides by their shared length. Large polygons use an explicitly representative diagram.

Questions

What is the formula for perimeter?

Perimeter is the sum of all outside side lengths. For a rectangle, P = 2(length + width); an 8 by 5 rectangle has perimeter 26 units.

How is perimeter different from area?

Perimeter measures the outside boundary in linear units. Area measures the space inside in square units. Internal diagonals are not part of the perimeter.

Can any three positive lengths make a triangle?

No. The two shorter sides must add to more than the longest side. Equality produces a flat, degenerate shape.

Does changing the unit convert the values?

No. The unit selector labels your values only. Enter all dimensions using the same unit and convert them yourself.

Sources and method

Calculate the total outside boundary length. Add each side once, or group equal sides using the perimeter formula for your shape.

We calculate with 40 significant digits and round only the displayed result. Diagrams are labelled explanations and are not measurement drawings.

More Math formulas

Browse Math calculators

Updated