Rectangle Length and Width from Perimeter Calculator
Enter the perimeter of a rectangle along with one other known value, either the length, the width, or the area, and this calculator instantly finds every missing dimension including the diagonal. Choose your solve mode from the dropdown, enter your numbers, and the results update as you type. Switch between metric and imperial units at any time.
Formula
Worked example
Perimeter = 20 m, Length = 6 m. Half-perimeter = 10 m. Width = 10 - 6 = 4 m. Area = 6 x 4 = 24 m^2. Diagonal = sqrt(36 + 16) = sqrt(52) = 7.2111 m. With P = 20 m and Area = 24 m^2 instead: discriminant = 10^2 - 4 x 24 = 100 - 96 = 4. L = (10 + 2) / 2 = 6 m, W = (10 - 2) / 2 = 4 m.
How to find the length and width of a rectangle from its perimeter
A rectangle has two pairs of equal sides. Its perimeter is P = 2L + 2W, which rearranges to L + W = P/2. That equation has one relationship between two unknowns, so you need exactly one more piece of information to pin down both sides. This calculator supports three combinations: perimeter plus the length (solve for width), perimeter plus the width (solve for length), and perimeter plus the area (solve via a quadratic equation). Select the mode that matches what you know, enter the values, and every missing dimension is found for you including the diagonal and the area.
Solving with perimeter and area - the quadratic approach
When you know both the perimeter P and the area A but neither side directly, substitution turns the problem into a quadratic. Set S = P/2, then L and W satisfy L + W = S and L x W = A. Substituting W = S - L into the area equation gives L^2 - S*L + A = 0. The quadratic formula yields L = (S + sqrt(S^2 - 4A)) / 2 and W = (S - sqrt(S^2 - 4A)) / 2. A real-valued rectangle only exists when the discriminant S^2 - 4A is non-negative, which is the same as saying P^2 >= 16A. When the discriminant is zero, L = W = P/4 and the rectangle is a square.
The rectangle diagonal and aspect ratio
Once both sides are known, the diagonal follows from the Pythagorean theorem: d = sqrt(L^2 + W^2). This is useful in construction and carpentry, where measuring the diagonals of a framed rectangle is the standard check for squareness (both diagonals must be equal). The aspect ratio L:W tells you the proportional relationship between the sides. A 16:9 widescreen panel and a 4:3 photo print both have the same perimeter formula, but very different shapes. Knowing the aspect ratio lets you compare a rectangle to standard formats in architecture, printing, photography, and digital media.
Metric and imperial units
This calculator works in any consistent unit system. Select metric to work in metres (or centimetres or millimetres, the label just tells you which system is active), or select imperial to work in feet (or inches). The formula is the same in both systems: enter your perimeter and second value in the same unit, and all outputs are returned in that same unit. Areas are in the square of that unit (m^2 or ft^2).
Common rectangle aspect ratios
| Ratio | Name / use | Example dimensions |
|---|---|---|
| 1:1 | Square | 10 x 10 |
| 4:3 | Traditional TV, monitor | 40 x 30 |
| 3:2 | Photo print, 35 mm film | 15 x 10 |
| 16:9 | Widescreen HD video | 160 x 90 |
| 16:10 | Laptop screens | 160 x 100 |
| 1:1.414 (A-series) | ISO paper (A4, A3 ...) | 210 x 297 mm |
| 8.5:11 | US Letter paper | 8.5 x 11 in |
| 2:1 (Univisium) | Cinema widescreen | 200 x 100 |
Named aspect ratios appear in architecture, screens, photography and printing. Knowing your rectangle's aspect ratio helps you match it to a standard format.
Frequently asked questions
Can I find both sides of a rectangle knowing only the perimeter?
No. The perimeter formula P = 2L + 2W gives one equation with two unknowns. You need at least one additional piece of information - either one of the sides or the area - to uniquely determine both dimensions. The only exception is a square, where L = W = P/4.
What is the formula for the width of a rectangle given its perimeter and length?
Rearrange P = 2L + 2W to get W = P/2 - L. Divide the perimeter by 2 and subtract the known length. For example, if P = 20 m and L = 6 m, then W = 10 - 6 = 4 m.
How do I solve for length and width when I know the perimeter and area?
Let S = P/2. The sides L and W satisfy L + W = S and L x W = A. Solve the quadratic L^2 - S*L + A = 0 using the quadratic formula: L = (S + sqrt(S^2 - 4A)) / 2 and W = (S - sqrt(S^2 - 4A)) / 2. A real rectangle exists only when S^2 >= 4A.
Why does the calculator say "no valid rectangle" for my perimeter and area?
A rectangle with perimeter P can have an area no larger than (P/4)^2, which is the area of the square with that perimeter. If you enter an area larger than this maximum - equivalently if P^2 < 16A - the discriminant becomes negative and no real-valued sides exist. Reduce the area or increase the perimeter until P^2 >= 16A.
How is the diagonal of a rectangle calculated?
Apply the Pythagorean theorem to the two sides: d = sqrt(L^2 + W^2). For a 6 m by 4 m rectangle, d = sqrt(36 + 16) = sqrt(52) = approximately 7.211 m. In construction this diagonal measurement is used to verify that a framed rectangle is perfectly square - both diagonals should measure the same length.
What aspect ratio does my rectangle have?
The aspect ratio is L divided by W, usually written as L:W or simplified to small whole numbers. A 15 cm by 10 cm rectangle has a ratio of 1.5:1 or equivalently 3:2, the classic photo-print format. The calculator displays the simplified ratio or the decimal ratio when no small-integer simplification is close enough.
Can I use this calculator with centimetres or inches instead of metres or feet?
Yes. The formula is unit-agnostic. Simply enter all values in the same unit. If your perimeter is in centimetres, enter it in centimetres; the calculated sides will also be in centimetres and the area in square centimetres. The unit selector changes the label displayed next to each field but does not convert values.