Rectangle Dimensions Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Enter the area and the perimeter of a rectangle; the calculator finds the two side lengths.
Result
Length (length units)
Width (length units)
- (P ÷ 2)² − 4A (must not be negative)
- Diagonal √(l² + w²) (length units)
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Area (square units): enter 0 or more.
- Perimeter (length units): enter 0 or more.
- Read the result: Length (length units); the panel also shows (P ÷ 2)² − 4A (must not be negative), Width (length units) and Diagonal √(l² + w²) (length units).
How this calculator works
With l + w = P ÷ 2 and l × w = A, the length and width are the two roots of t² − (P ÷ 2)·t + A = 0: l, w = (P ÷ 2 ± √((P ÷ 2)² − 4A)) ÷ 2.
No rectangle exists when (P ÷ 2)² − 4A is negative, because for a given perimeter the square has the largest area, P² ÷ 16. The diagonal is √(l² + w²).
The formula
| Symbol | Meaning | Unit |
|---|---|---|
| Area | square units | |
| Perimeter | length units | |
| (P ÷ 2)² − 4A (must not be negative) | ||
| Length | length units |
Worked example
| Area (square units) | 24 |
|---|---|
| Perimeter (length units) | 20 |
| (P ÷ 2)² − 4A (must not be negative) | 4 |
|---|---|
| Width (length units) | 4 |
| Diagonal √(l² + w²) (length units) | 7.2111 |
Length (length units) 6
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What are the sides of a rectangle with area 24 and perimeter 20?
6 and 4: they add up to 10 and multiply to 24; the diagonal is about 7.2111.
Can a rectangle have area 30 and perimeter 20?
No. With a perimeter of 20 the largest possible area is the 5 × 5 square, 25.