Skip to main content

Perimeter of a Rectangle Calculator

Calculate the perimeter of a rectangle, the total length of its outline, from its length and width. The formula P = 2 × (L + W) explained, practical examples (baseboards, fencing, picture frame) and different units accepted for each side.

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Perimeter

-

Was this tool useful?

How does this tool work?

This calculator adds up the four sides of a rectangle to give its perimeter, the total length of its outline. It is the measurement you need to install baseboards, fence a yard, bind a rug, frame a picture or check an elementary or middle school geometry exercise.

A rectangle has two equal lengths and two equal widths. Its perimeter is therefore P = L + W + L + W, written P = 2 × (L + W) or P = 2L + 2W. With a length of 5 m and a width of 3 m: 2 × (5 + 3) = 16 m.

The two dimensions can be entered in different units; they are converted before being added. The result is a length, expressed in the unit of the first field, not an area: perimeter is measured in meters, centimeters or feet, never in m² or ft².

Perimeter and area do not move together. Two plots with the same perimeter can have very different areas: 2 × (10 + 10) = 40 m for 100 m², but 2 × (19 + 1) = 40 m as well for only 19 m². For a given perimeter, the square is the rectangle that encloses the most area.

In practice, you often subtract lengths from the outline: the width of doorways for baseboards, the width of a gate for a fence. You can also do the opposite and add a cutting allowance.

How to use this tool

  1. Enter the length

    Type the value and its unit, which will also be the unit of the result.

  2. Enter the width

    Choose any unit you like: the values are harmonized before the calculation.

  3. Read the perimeter

    The length of the outline appears instantly and updates as you type.

The formula for the perimeter of a rectangle

The outline of a rectangle is made of two lengths and two widths.

Perimeter

P = 2 × (L + l)

Twice the sum of the length and the width.

Expanded form

P = 2L + 2l

The same calculation, doubling each side separately.

Missing dimension

l = P ÷ 2 − L

Find the width from the perimeter and the length.

P
perimeter, in length units
L
length
l
width (W)

Example: L = 12 cm and W = 7 cm, P = 2 × 19 = 38 cm.

Use cases

DIY and trim work

Work out the length of baseboard, crown molding, caulk or corner bead around a rectangular room.

Yard and fencing

Estimate the wire fencing, edging or number of posts needed around a lot or a vegetable garden.

School

Check a perimeter exercise, compare perimeter and area or find a missing dimension.

Sewing and framing

Measure the binding for a rug, the trim for a tablecloth or the molding for a frame.

Examples

Straight calculation

2 × (5 + 3) = 2 × 8 = 16 m.

Input

L = 5 m, W = 3 m

Result

P = 16 m

Baseboards for a bedroom

Perimeter of 15.6 m, minus the doorway: 15.6 − 0.83 = 14.77 m.

Input

room 4.2 m × 3.6 m, door 0.83 m

Result

≈ 14.77 m of baseboard

Fencing a lot

2 × (30 + 18) = 96 m, minus the gate: 92.5 m.

Input

L = 30 m, W = 18 m, gate 3.5 m

Result

92.5 m of fencing

Picture frame

You need 1.40 m of molding, plus the offcuts from the miter cuts at the four corners.

Input

L = 40 cm, W = 30 cm

Result

P = 140 cm

Mixed units

45 cm = 0.45 m, so 2 × (1.5 + 0.45) = 3.9 m.

Input

L = 1.5 m, W = 45 cm

Result

P = 3.9 m

Tips and best practices

  • Add the length and width first, then multiply by two: it is faster and reduces mistakes.
  • Perimeter is a length (m, cm, ft); if your result is in m² or ft², it is an area.
  • Subtract openings (doors, gates) when you calculate a length of material to install.
  • Allow 5 to 10% extra for cuts, especially with miter cuts.
  • For a fence, plan one post about every 2 to 2.5 m (6 to 8 ft), plus one at each corner.

Sources and references

Frequently asked questions

What is the formula for the perimeter of a rectangle?

P = 2 × (L + W), twice the sum of the length and the width. It is the same as adding up the four sides.

How do I find the width from the perimeter?

Divide the perimeter by two, then subtract the length: W = P ÷ 2 − L. A rectangle with a 26 cm perimeter and a length of 8 cm is 5 cm wide.

What is the difference between perimeter and area?

Perimeter measures the outline (in m or ft), area measures the surface inside (in m² or ft²). For a room, perimeter is for the baseboards and area is for the flooring.

Is the perimeter of a square calculated the same way?

Yes, a square is a rectangle whose length equals its width. The formula simplifies to P = 4 × s.

How do I calculate the baseboards for a room?

Calculate the perimeter of the room, subtract the width of each doorway, then add about 10% for cuts. Divide by the length of one piece to get the number of pieces to buy.

Related tools

Tools similar or complementary to this one.

Similar tools

Calculate fence panels, posts and footing concrete.

Mathematics & calculationUse this tool