About the rectangle calculator
A rectangle is fixed by two independent measurements. Most people know the length and width, but this calculator also works backwards: give it the area and perimeter, the diagonal and one side, or the diagonal and the area, and it recovers the sides.
When only area and perimeter (or diagonal) are given, the two sides are the roots of a quadratic; the longer root is reported as the length.
Formulas
| Area | A = l·w |
| Perimeter | P = 2(l + w) |
| Diagonal | d = √(l² + w²) |
Frequently asked questions
How do I find the length and width from area and perimeter?
The sides are the two solutions of x² − (P/2)x + A = 0. For P = 26 and A = 40 you get x = 8 and x = 5.
How do I calculate a rectangle’s diagonal?
Use the Pythagorean theorem: d = √(l² + w²). An 8 × 5 rectangle has a diagonal of √89 ≈ 9.434.