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.
| 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. |
Plug in your numbers and get instant step-by-step results.