Home
Enter the two side lengths of the rectangle in the same unit. Both must be non-negative. Length and width are interchangeable — the perimeter formula works either way. Use the advanced options to change units and decimal precision.

🔁 Find the Missing Side

Know the perimeter, the area or the diagonal, plus one side? Enter them below to recover the other side. The unit and precision from the main calculator are used.

What Is the Perimeter of a Rectangle?

The perimeter of a rectangle is the total length of its boundary — the distance you would walk if you traced every edge exactly once. For a rectangle with length a and width b, the four sides are a, b, a, b going around the shape, so the total is a + b + a + b = 2(a + b).

a b d a b

Rectangle Perimeter Formula

P = 2(a + b) = 2a + 2b

Here a is the length (the longer side) and b is the width (the shorter side). The quantity a + b is called the semi-perimeter and is denoted s:

s = P / 2 = a + b

Other Rectangle Measurements

QuantityFormulaUnits
PerimeterP = 2(a + b)linear (cm, m, in…)
Semi-perimeters = a + blinear
AreaA = a × bsquare (cm², m², in²…)
Diagonald = √(a² + b²)linear
Aspect ratioa / bdimensionless

The diagonal formula is a direct application of the Pythagorean theorem: the diagonal splits the rectangle into two congruent right triangles, each with legs a and b and hypotenuse d.

Worked Examples

Length aWidth bPerimeter PArea ADiagonal d
8526409.4340
10104010014.1421
124324812.6491
7.532122.58.0777
11411.4142

How to Find a Missing Side

The perimeter formula can be rearranged to solve for an unknown side, provided you know enough other information. The three most common cases are:

1. From the perimeter and one side

b = P/2 − a

For example, if P = 30 m and a = 9 m, then b = 15 − 9 = 6 m. The side must not exceed P/2, otherwise no valid rectangle exists.

2. From the area and one side

b = A / a

For example, if A = 48 m² and a = 12 m, then b = 4 m, and the perimeter is 32 m.

3. From the diagonal and one side

b = √(d² − a²)

For example, if d = 13 cm and a = 12 cm, then b = √(169 − 144) = 5 cm, and the perimeter is 2(12 + 5) = 34 cm.

Why Area Alone Is Not Enough

Many rectangles share the same area but have different perimeters. With an area of 12, for example:

SidesAreaPerimeter
1 × 121226
2 × 61216
3 × 41214
√12 × √12 ≈ 3.4641 × 3.46411213.8564

This is a special case of the isoperimetric inequality: for a fixed perimeter, the square encloses the maximum area. Conversely, for a fixed area, the square has the minimum perimeter.

Real-World Applications

  • Fencing a garden or yard — the perimeter tells you how much fencing you need.
  • Picture framing — the frame length equals the perimeter plus corner allowances.
  • Baseboards and crown moulding — the room perimeter gives the total linear length of trim.
  • Gift wrapping and boxing — ribbon length along the edges of a box face is a perimeter.
  • Running tracks and sports fields — lane lengths around a rectangular infield.
  • Material estimation — fabric for a tablecloth border, tape around a parcel, wire for a frame.

Rectangle vs Other Quadrilaterals

ShapePerimeter formulaNotes
SquareP = 4sAll four sides equal
RectangleP = 2(a + b)Opposite sides equal
ParallelogramP = 2(a + b)Same formula as rectangle
RhombusP = 4sAll sides equal, angles not 90°
TrapezoidP = a + b + c + dSum of all four sides

Units and Precision

Perimeter is a length, so it is measured in linear units: millimetres, centimetres, metres, kilometres, inches, feet, yards or miles. The area, by contrast, is measured in the corresponding squared units. Mixing units (for example entering a length in centimetres and a width in inches) gives a meaningless result — always convert to a common unit first.

The calculator displays results to the precision you choose, from 0 to 10 decimal places. When the inputs are integers and the result is exact (such as P = 26), trailing zeros are removed. When the diagonal is irrational (such as √89 ≈ 9.4340), the value is rounded at the last decimal place shown.

Assumptions and Limitations

  • Both the length and the width must be non-negative real numbers; decimals are accepted.
  • The two sides must be entered in the same unit.
  • A rectangle with a zero side is degenerate — the perimeter reduces to twice the other side, and the area is zero.
  • The reverse solver requires a positive known side when solving from the area (to avoid division by zero).
  • For the diagonal mode, the diagonal must be at least as long as the known side (the hypotenuse of a right triangle is never shorter than a leg).
  • This calculator handles 2D rectangles only. For three-dimensional boxes, use a rectangular-prism or cuboid calculator.

❓ Rectangle Perimeter FAQ

What is the perimeter of a rectangle?

The perimeter of a rectangle is the total length of its boundary — the distance you would travel if you walked all the way around it. For a rectangle with length a and width b, the perimeter is P = 2(a + b). For example, a rectangle measuring 8 m by 5 m has a perimeter of 2 × (8 + 5) = 26 m.

What is the formula for the perimeter of a rectangle?

P = 2(a + b), where a is the length and b is the width. This is just the sum of all four sides: a + b + a + b = 2a + 2b.

How do I find the perimeter of a rectangle with length 8 and width 5?

Substitute into P = 2(a + b): P = 2(8 + 5) = 2 × 13 = 26. The perimeter is 26 units. The area is 8 × 5 = 40 square units and the diagonal is √(8² + 5²) = √89 ≈ 9.434 units.

Can I find the perimeter if I only know the area?

No. Area alone is not enough — many rectangles share the same area but have different perimeters (for example 1 × 12, 2 × 6 and 3 × 4 all have area 12 but perimeters 26, 16 and 14). You need at least one side length, or the diagonal, in addition to the area.

How do I find the missing side of a rectangle from its perimeter?

Rearrange P = 2(a + b) to solve for the unknown side: b = P/2 − a. For example, if P = 30 m and a = 9 m, then b = 15 − 9 = 6 m. The calculator's reverse mode does this automatically.

How do I find the perimeter from the diagonal?

You need one side in addition to the diagonal. Since d² = a² + b², the other side is b = √(d² − a²), and the perimeter is P = 2(a + b). For example, with d = 13 and a = 12, b = √(169 − 144) = 5, so P = 2(12 + 5) = 34.

What is the difference between perimeter and area?

Perimeter is a length — the distance around the outside edge — measured in linear units such as cm or m. Area is the amount of flat surface enclosed inside the rectangle, measured in square units such as cm² or m². For a rectangle, perimeter = 2(a + b) and area = a × b.

Is the perimeter of a rectangle measured in square units?

No. Perimeter is a one-dimensional length, so it uses linear units (mm, cm, m, km, in, ft, yd, mi). Square units are used for area, not perimeter.

What is the perimeter of a square?

A square is a rectangle with all four sides equal, so a = b = s, and the perimeter formula collapses to P = 4s. For a square with side 7 cm, the perimeter is 28 cm.

What is the semi-perimeter of a rectangle?

The semi-perimeter is half the perimeter, s = P/2 = a + b. It is used in several area and triangle formulas, and it is the sum of the length and width of a rectangle.

Does rotating a rectangle change its perimeter?

No. A rotation is a rigid transformation: it moves the rectangle without stretching or shrinking it, so the side lengths — and therefore the perimeter — stay the same.

For a fixed perimeter, which rectangle has the largest area?

The square. For a fixed perimeter P, the area A = a × b is maximised when a = b = P/4. This is a special case of the isoperimetric inequality. For example, with P = 20, the square 5 × 5 has area 25, while a 6 × 4 rectangle has area 24 and a 7 × 3 rectangle has only 21.