Rectangle Formula

Area, perimeter, and diagonal of any rectangle (or square)

Reviewed by [email protected], Geometry Calculator Developer & Online Math Educator Last updated May 12, 2026

A rectangle is a four-sided polygon with all four angles equal to 90°. Length l and width w are the two different side lengths. A square is a rectangle with l = w. Just three formulas cover all rectangle calculations.

The Formulas

Name Formula Notes
Area A = l × w l = length, w = width. Same units as the sides, squared.
Perimeter P = 2 × (l + w) = 2l + 2w Sum of all four sides; opposite sides are equal so it's twice the sum of length + width.
Diagonal d = √(l² + w²) Pythagorean theorem applied to the right-angled corner.
Width from Area + Length w = A / l Inverse — given the area and one side, recover the other.
Length from Perimeter + Width l = P/2 − w Inverse — solve for length when you know perimeter and width.
Square Special Case A = s², P = 4s, d = s·√2 When l = w = s, all formulas collapse to single-variable forms.

Worked Examples

Example 1: Rectangle 8 cm × 5 cm

  1. Area A = 8 × 5 = 40 cm²
  2. Perimeter P = 2(8 + 5) = 26 cm
  3. Diagonal d = √(8² + 5²) = √89 ≈ 9.43 cm

Example 2: Find length given area = 60, width = 5

  1. l = A / w = 60 / 5 = 12
  2. P = 2(12 + 5) = 34; d = √(144 + 25) = √169 = 13

Example 3: Square with side 6

  1. A = 6² = 36
  2. P = 4 × 6 = 24
  3. d = 6√2 ≈ 8.485

Skip the manual calculation

Plug in your numbers and get instant step-by-step results.

Use Rectangle Calculator See All Geometry Formulas