Skip to content
FiftyCalc Free calculators for all 50 states

Length and Width of a Rectangle from the Perimeter

Test cases replayed : 4 of 4 match · Methodology · No outside source listed

A perimeter alone fits many rectangles, so add one more fact: the area, the ratio of the sides, or one side.

Result

Sample figures

Length (length units)—

Width (length units) —

  • Area (square units)—
  • Diagonal (length units)—
  • Largest area possible with this perimeter (a square)—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Length and Width of a Rectangle from the Perimeter Calculator

Besides the perimeter, I know

Besides the perimeter, I know: choose The area, The ratio length ÷ width or The length. Prefilled example: The area.

Perimeter (length units): enter 0 or more. Prefilled example: 20.

Area (square units; first choice): enter 0 or more. Prefilled example: 21.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Besides the perimeter, I know: choose The area, The ratio length ÷ width or The length.
  2. Perimeter (length units): enter 0 or more.
  3. Area (square units; first choice): enter 0 or more.
  4. Ratio length ÷ width (second choice, e.g. 2 for 2:1): enter 0 or more.
  5. Length (length units; third choice): enter 0 or more.
  6. Read the result: Length (length units); the panel also shows Width (length units), Area (square units), Diagonal (length units) and Largest area possible with this perimeter (a square).

How this calculator works

Perimeter P = 2(L + W), so L + W = P ÷ 2. With the area A = L × W as well, L and W are the two roots of t² − (P/2)t + A = 0: L = (P/2 + √(P²/4 − 4A)) ÷ 2 and W = P/2 − L.

With a ratio r = L ÷ W, W = P ÷ (2(1 + r)) and L = r × W. With one side, the other is P ÷ 2 minus that side.

Of all rectangles with the same perimeter, the square has the largest area, P² ÷ 16. A larger area than that is impossible and shows a dash.

The formula

  1. Len={P÷2+P24−4×A2if m=1r×P2×(1+r)if m=2Lotherwise
Symbols used in the formula
SymbolMeaningUnit
mBesides the perimeter, I know (1: The area; 2: The ratio length ÷ width; 3: The length)
PPerimeterlength units
AArea (first choice)square units
rRatio length ÷ width (second choice, e.g. 2 for 2:1)
LLength (third choice)length units
LenLengthlength units

Worked example

Besides the perimeter, I knowThe area
Perimeter (length units)20
Area (square units; first choice)21
Width (length units)3
Area (square units)21
Diagonal (length units)7.6158
Largest area possible with this perimeter (a square)25
  1. Len=20÷2+2024−4×212=7

Length (length units) 7

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

A rectangle has a perimeter of 20 and an area of 21. What are its sides?

L + W = 10 and L × W = 21, so the sides are 7 and 3.

A rectangle's perimeter is 30 and it is twice as long as it is wide. What are its sides?

The width is 30 ÷ (2 × 3) = 5 and the length is 10, for an area of 50.

Questions answered

Related calculators