Rectangle Length and Width Calculator
Enter the area and perimeter of a rectangle to find both dimensions at once using the quadratic formula. Alternatively, supply the area and one known side to divide straight through. The calculator also computes the diagonal and shows every step of the algebra with your actual numbers. Switch between metric and imperial units - all results update instantly.
Formula
Worked example
Rectangle with area 24 m² and perimeter 20 m: S = 20/2 = 10, discriminant = 10² - 4×24 = 100 - 96 = 4, √4 = 2. Length = (10+2)/2 = 6 m, Width = (10-2)/2 = 4 m. Check: 6×4 = 24 m², 2(6+4) = 20 m. Diagonal = √(36+16) = √52 ≈ 7.211 m.
How the quadratic formula solves the rectangle
When you know a rectangle's area (A) and perimeter (P), you have two simultaneous equations: L + W = P/2 (from the perimeter definition) and L x W = A (from the area definition). Substituting W = P/2 - L into the area equation gives the quadratic L² - (P/2)L + A = 0. The quadratic formula then yields L = (S + √(S² - 4A)) / 2 and W = (S - √(S² - 4A)) / 2, where S = P/2. The larger root becomes the length and the smaller the width. If the discriminant S² - 4A is negative, no real rectangle can have those dimensions: in that case the perimeter is too small to enclose the required area (equivalently, P² < 16A).
Solving from area and one known side
If you already know one side length s and the area A, solving is straightforward: the other side equals A / s. There is no quadratic needed. This mode is common in flooring and tiling: you know the room length and total floor area, and you need to find how wide the room is. Similarly, for fabric, wallpaper, or garden beds, if you measure one dimension and know the total area, divide to get the other.
The diagonal and why it matters
The diagonal of a rectangle is the straight-line distance between opposite corners. By the Pythagorean theorem, d = √(L² + W²). Builders use the diagonal to confirm a rectangle is perfectly square: if the two measured diagonals of a framed wall or room are equal, the corners are at 90 degrees. Landscapers, tile setters, and furniture makers all rely on diagonal checks. The 3-4-5 right triangle is the classic example: a rectangle 3 x 4 has a diagonal of exactly 5. A rectangle 6 x 8 has a diagonal of 10, and so on.
Existence condition and practical limits
A real rectangle can only exist when P² is at least 16 times the area (P² >= 16A). Rearranging, this means the perimeter must be at least 4√A, which is the perimeter of a square with the same area. In other words, the square is the rectangle with the smallest perimeter for a given area. If you enter a perimeter smaller than 4√A, the discriminant is negative and there is no solution. Practically, if you are designing a room or garden bed and your perimeter seems too tight for the required area, you need to either increase the perimeter (use more fencing, more wall) or reduce the area target.
Common rectangle aspect ratios
| Name | Ratio (L:W) | Typical use |
|---|---|---|
| Square | 1:1 | Floor tiles, profile photos, Instagram posts |
| Golden rectangle | 1.618:1 | Architecture, art, product design |
| A-series paper (A4, A3, etc.) | 1.414:1 | International paper standard (ISO 216) |
| Widescreen HD | 1.778:1 (16:9) | TV screens, YouTube, presentations |
| Classic film | 1.333:1 (4:3) | Old TV, older monitors, standard photo |
| Architectural door | 2.0:1 (approx) | Interior doors (e.g. 80 in x 36 in) |
| Standard brick | 2.25:1 (approx) | Modular brick face (3.75 in x 2.25 in) |
| Road lane | 5:1 or higher | Highway lanes, runways, parking spaces |
Standard proportions used in design, construction, and photography. The aspect ratio is length divided by width.
Frequently asked questions
What if I only know the area and no other measurement?
Area alone does not uniquely define a rectangle. Infinitely many rectangles share the same area (a 1 x 24 rectangle has the same area as a 4 x 6 one). You need at least one more piece of information: the perimeter, one side, the diagonal, or the aspect ratio. Once you have two independent measurements, this calculator can solve for the rest.
Why does the quadratic formula give two roots - which one is length?
The two roots of the quadratic are the two side lengths. By convention, the larger root is the length (longer side) and the smaller root is the width (shorter side). Both are valid dimensions of the same rectangle. For a square, both roots are equal.
What is the condition for a valid rectangle from area and perimeter?
A real rectangle exists only when the discriminant (P/2)² - 4A is non-negative, which simplifies to P² >= 16A. If you enter values that violate this, the calculator will tell you and suggest how to adjust your inputs. The boundary case (discriminant = 0) is a square.
Can I use this for square footage calculations?
Yes. Switch the unit system to imperial (feet and square feet), enter your square footage as the area and the perimeter in feet, and the calculator returns both dimensions in feet. This is useful when you know a room's total floor area and perimeter but not the individual wall lengths.
How does the diagonal help verify a rectangle is square?
If the two diagonals of a physical rectangle are measured and they are equal, the corners are true right angles. In construction this is called "squaring up" a frame. You can use the diagonal from this calculator as the target measurement when checking a layout: mark out the four corners, measure corner to corner in both directions, and adjust until both diagonals match the calculated value.
What is an aspect ratio and why does it matter?
The aspect ratio is the ratio of the longer side to the shorter side, written as L:W or as a decimal. A 6 x 4 rectangle has an aspect ratio of 3:2 (or 1.5:1). Aspect ratio matters in design (screens, photos, paper), construction (door and window proportions), and layout (fitting rectangles into a given space). Two rectangles with the same aspect ratio are similar: one is just a scaled version of the other.