Perimeter of a Rectangle Calculator
Enter the length and width of a rectangle to calculate its perimeter instantly. You can also enter the perimeter and one side to find the missing dimension. Switch between metric and imperial units, and see the full step-by-step working.
Formula
Worked example
A rectangle with length 8 m and width 5 m: P = 2 × (8 + 5) = 2 × 13 = 26 m. The area is 8 × 5 = 40 m². The diagonal is √(8² + 5²) = √89 ≈ 9.434 m.
What is the perimeter of a rectangle?
The perimeter of a rectangle is the total distance around its boundary. Because a rectangle has two pairs of equal opposite sides, the perimeter is always twice the sum of the length and the width: P = 2(l + w). If you walk the full outline of an 8 m by 5 m room, you cover 2 × (8 + 5) = 26 m. The formula works in any consistent unit: metres, centimetres, feet, inches or yards.
How to use this calculator
Select "Perimeter" to compute the perimeter from any length and width you enter. Switch to "Length" or "Width" to reverse-solve: enter the known perimeter and one side to find the missing side. The "Area and perimeter" mode shows both the perimeter and the enclosed area in one step, while the "Diagonal, area and perimeter" mode also returns the corner-to-corner diagonal via the Pythagorean theorem. Toggle between metric (metres) and imperial (feet) with the units selector. Every result updates as you type, and the Show your work panel traces each arithmetic step with your actual numbers.
The rectangle perimeter formula and how it is derived
A rectangle has four sides: two of length l and two of width w. The perimeter sums all four: P = l + w + l + w = 2l + 2w = 2(l + w). To reverse-solve for a missing side, rearrange: l = P/2 - w and w = P/2 - l. The area is A = l × w, a separate quantity that grows with the square of scale, not linearly like perimeter. The diagonal follows the Pythagorean theorem: d = √(l² + w²), and it equals the diameter of the circumscribed circle.
Practical uses of rectangle perimeter
Perimeter is the go-to measurement any time you need to border, edge, fence or trim a rectangular space. Landscaping and fencing projects use it to price materials by the linear metre or foot. Picture framing, flooring borders, and decorative mouldings all require an accurate perimeter. In construction, knowing the perimeter of a foundation helps estimate concrete formwork. In sport, pitch and court dimensions are regulated by perimeter. The diagonal is equally practical: carpenters use it to check that a rectangular frame is truly square by confirming that both diagonals are equal.
Common rectangle perimeter examples
| Object | Length | Width | Perimeter |
|---|---|---|---|
| Letter paper (A4) | 29.7 cm | 21.0 cm | 101.4 cm |
| Standard door | 2.0 m | 0.9 m | 5.8 m |
| Football pitch (FIFA min) | 100 m | 64 m | 328 m |
| Tennis court (singles) | 23.77 m | 8.23 m | 64 m |
| Olympic swimming pool | 50 m | 25 m | 150 m |
| Basketball court (NBA) | 28.65 m | 15.24 m | 87.78 m |
| Letter paper (US) | 27.94 cm | 21.59 cm | 99.06 cm |
| King-size bed | 213.4 cm | 193 cm | 812.8 cm |
Perimeters for typical real-world rectangles, calculated with P = 2 × (l + w).
Frequently asked questions
What is the formula for the perimeter of a rectangle?
The formula is P = 2(l + w), where l is the length and w is the width. You add the two different side lengths and multiply by two because a rectangle has two pairs of equal sides. For example, a rectangle 8 m long and 5 m wide has a perimeter of 2 × (8 + 5) = 26 m.
How do I find the length if I know the perimeter and width?
Rearrange the formula: l = P/2 - w. Divide the perimeter by two, then subtract the width. For a perimeter of 26 m and a width of 5 m, the length is 26/2 - 5 = 13 - 5 = 8 m. Use the "Length" mode in this calculator and it works this out for you automatically.
Is the perimeter the same as the area of a rectangle?
No. Perimeter is the total distance around the boundary and is measured in linear units such as metres or feet. Area is the surface enclosed by the rectangle and is measured in square units such as m² or ft². A rectangle 8 m by 5 m has a perimeter of 26 m but an area of 40 m². They can numerically coincide only by coincidence.
How do I calculate the diagonal of a rectangle?
Use the Pythagorean theorem: d = √(l² + w²). Square each side length, add the results, then take the square root. For length 8 m and width 5 m, the diagonal is √(64 + 25) = √89 ≈ 9.43 m. This calculator returns the diagonal whenever length and width are both known.
Does a square use the same perimeter formula?
Yes. A square is a special rectangle where l = w, so P = 2(l + w) = 2(s + s) = 4s, where s is the side length. The perimeter-of-a-rectangle formula gives the correct answer for a square when both sides are set equal.
What units does this calculator support?
Switch between metric (metres) and imperial (feet) using the Units selector. You can enter any decimal value in those units. If your measurements are in centimetres or inches, convert them first by dividing by 100 (for cm to m) or 12 (for in to ft), or simply use the same consistent unit throughout and attach the correct label to your result.