Skip to content
Other

Length of a Rectangle Calculator

Enter any two known values for your rectangle and this calculator instantly solves for the missing length. Choose from four formula modes: area plus width, perimeter plus width, diagonal plus width, or simultaneous area and perimeter. Switch between metric and imperial units at any time.

Your details

Pick the two values you already know. The calculator solves for length, width (when needed), and any other missing dimension.
The surface area of the rectangle.
The shorter side of the rectangle (width).
m
Length
6

The longer (or equal) side of the rectangle

Width4
Area24
Perimeter20
Diagonal7.2111
_unitLabelm

Length = 6.0000 m

  • The rectangle measures 6.0000 m (length) by 4.0000 m (width).
  • Area is 24.0000 m², perimeter is 20.0000 m, and the diagonal is 7.2111 m.
  • The length-to-width ratio is 1.50:1. The golden ratio is approximately 1.618:1 for comparison.

Next stepUse the length and width to calculate paint coverage, flooring area, or fencing needed by multiplying or adding the sides as required.

How to find the length of a rectangle

A rectangle has four properties that are all related: length (L), width (W), area (A), perimeter (P), and diagonal (d). If you know any two of these you can calculate the rest. The most common approach is dividing the area by the width (L = A / W). If you know the perimeter instead, rearrange P = 2(L + W) to get L = P/2 - W. If you have measured the diagonal (the line from one corner to the opposite corner), the Pythagorean theorem gives L = sqrt(d^2 - W^2). And if you only know the area and the perimeter but not the width, you can still solve for length by treating it as a quadratic equation: x^2 - (P/2)x + A = 0.

Unit switching and real-world use

This calculator works in both metric (metres, square metres) and imperial (feet, square feet) units. Switch units in the top dropdown and all inputs and outputs update to match. Real-world applications include working out how long a wall must be given its area and height, finding the longer dimension of a room from a floor-plan perimeter, or determining a screen or panel length from its diagonal and aspect ratio. The length-to-width ratio also helps with design: the golden ratio (about 1.618:1) appears in architecture and art as a naturally pleasing proportion.

Understanding the diagonal formula

Because every rectangle contains two right triangles, the Pythagorean theorem applies directly: the diagonal squared equals the length squared plus the width squared. Rearranging gives length = sqrt(d^2 - W^2). This mode is especially useful when you measure a diagonal with a tape measure to verify that a corner is square: if d = sqrt(L^2 + W^2) exactly, all four corners are at 90 degrees. Note that the diagonal must be longer than the width for a real solution to exist.

Solving from area and perimeter together

If you know only the total area and the total perimeter of a rectangle, but not either side individually, you can still solve for both dimensions. Let s = P/2 (the half-perimeter). The two sides L and W satisfy: s = L + W and A = L x W. Substituting gives the quadratic x^2 - sx + A = 0, with solutions (s plus-or-minus sqrt(s^2 - 4A)) / 2. The larger root is the length and the smaller root is the width. A real solution requires s^2 >= 4A, which means the perimeter must be large enough to enclose the given area.

Rectangle formula reference

FindFormulaNotes
Length (L)L = A / WGiven area and width
Length (L)L = P/2 - WGiven perimeter and width
Length (L)L = sqrt(d^2 - W^2)Given diagonal and width (Pythagorean theorem)
Length (L)L = (P/2 + sqrt((P/2)^2 - 4A)) / 2Given area and perimeter only
Area (A)A = L x WMultiply length by width
Perimeter (P)P = 2(L + W)Sum of all four sides
Diagonal (d)d = sqrt(L^2 + W^2)Pythagorean theorem

All four core formulas for a rectangle with length L, width W, diagonal d, perimeter P, and area A.

Frequently asked questions

How do you find the length of a rectangle if you only know the area and width?

Divide the area by the width: length = area / width. For example, if the area is 24 m^2 and the width is 4 m, the length is 24 / 4 = 6 m. This comes directly from rearranging the area formula A = L x W.

How do you find the length of a rectangle from the perimeter?

Use the formula length = P/2 - W, where P is the perimeter and W is the width. The perimeter of a rectangle is P = 2(L + W), so L + W = P/2, and therefore L = P/2 - W. For example, a perimeter of 20 m and a width of 4 m gives length = 10 - 4 = 6 m.

Can you find the length of a rectangle from the diagonal?

Yes, if you also know the width. Because a rectangle contains right triangles, the Pythagorean theorem gives d^2 = L^2 + W^2. Rearranging: length = sqrt(d^2 - W^2). For example, a diagonal of 10 m and a width of 6 m gives length = sqrt(100 - 36) = sqrt(64) = 8 m.

What if I only know the area and perimeter, but not the width?

You can still solve for both dimensions using a quadratic equation. Set s = P/2. Then the two sides satisfy x^2 - sx + A = 0. The solutions are (s +/- sqrt(s^2 - 4A)) / 2. The larger solution is the length. This only has a real answer when s^2 >= 4A (i.e., the perimeter is large enough to enclose the given area).

What is the difference between length and width in a rectangle?

By convention, length is the longer side and width is the shorter side. In practice, different fields use different conventions: builders may call the horizontal dimension the width and the vertical dimension the height, while mathematicians often use length for either side. This calculator always outputs the larger value as the length and the smaller as the width.

Does this calculator work in imperial units?

Yes. Switch to imperial using the unit dropdown at the top. All inputs switch to feet (for length dimensions) and square feet (for area). The formulas are identical regardless of units, so the same math applies whether you are working in metres or feet.

Sources

Written by Grace Mbeki, MSc Data Scientist & Educator · Nairobi, Kenya

Turning everyday numbers into clear, actionable answers for the decisions that matter most.

Search 3,500+ calculators

Loading search…