Dimensions of a Rectangle Calculator

Dimensions of a Rectangle Calculator

Find the two side lengths of a rectangle from its area and perimeter, with live validation for combinations that cannot form a real rectangle.

Area: 24 m² Perimeter: 20 m Valid rectangle

Excel export is ready for the example values.

Rectangle inputs

m²

Positive area in the selected square unit.

m

Total boundary length in the selected unit.

Changing units converts both entered measurements and the calculated dimensions.

A real rectangle exists only when P² ≥ 16A. Equality gives a square.

Dimensions

Length (a)
6 m
Width (b)
4 m

For the example, 6 × 4 = 24 m² and 2 × (6 + 4) = 20 m.

Length 6 meters, width 4 meters.

How to use this dimensions of a rectangle calculator

What this calculator does

This calculator recovers the two side lengths of a rectangle when you know its Area (A) and Perimeter (P). It solves the standard rectangle identities A = a × b and P = 2(a + b) together, then reports the larger root as Length (a) and the smaller root as Width (b). This is an exact algebraic reconstruction for valid numeric inputs; it does not infer a rectangle from an approximate sketch, image, or rounded field measurement.

When to use it

Use it when a geometry exercise gives area and perimeter but hides the sides; when checking whether a proposed floor, panel, garden bed, or rectangular layout is mathematically possible; or when reversing summary measurements from a specification into side lengths. The underlying formulas are the same rectangle models described in OpenStax's algebra applications guide.

How to calculate

  1. The calculator opens with a complete demonstration: Area (A) = 24 m², Perimeter (P) = 20 m, and Unit = meters (m). Its Excel workbook is available immediately.
  2. Replace the example values with your area and perimeter. Results update live. If the combination cannot form a real rectangle, the calculator explains the constraint instead of producing imaginary or non-finite sides.
  3. Choose a different Unit when needed. The calculator converts the current area, perimeter, length, and width so the physical rectangle stays the same.
  4. Read Length (a) and Width (b), then use Download Excel to export the current valid state. Reset clears the demonstration and your entered values; after Reset, Excel export is disabled until a complete valid state is entered again.

Input guide

Area (A) is required and must be a positive finite number. It uses the square of the selected unit, such as m² or ft². Plain decimals, scientific notation, and standard comma thousands grouping are accepted; ambiguous decimal-comma forms are rejected. A realistic example is 24 m². Increasing area while holding perimeter fixed pushes the dimensions toward one another until the rectangle becomes a square; beyond that maximum area, no real rectangle exists. A common mistake is entering a linear unit value here rather than a square-unit value.

Perimeter (P) is required and must also be a positive finite number. It is the full boundary length, not the sum of only one length and one width. For example, 20 m means 2(a+b)=20. Increasing perimeter while area stays fixed generally makes the possible rectangle more elongated. The important feasibility rule is P² ≥ 16A; a smaller perimeter cannot enclose the stated area as a rectangle.

Unit is required and can be centimeters, meters, inches, or feet. It controls both the perimeter unit and the squared area unit. Changing from meters to centimeters, for example, converts 20 m to 2,000 cm and 24 m² to 240,000 cm² rather than merely relabeling the values. NIST explains the distinction between SI length units and square units used for area.

Output guide

Length (a) is the larger of the two recovered side lengths, while Width (b) is the smaller. Both use the selected linear unit. Swapping the names of the two sides would describe the same rectangle, so ordering them makes the result consistent. When the discriminant is zero, length and width are equal and the rectangle is a square. A very small width paired with a large length indicates an elongated rectangle; both values always remain positive for a valid input pair.

Worked example

With the startup values A = 24 m² and P = 20 m, substitute b = P/2 – a into the area equation. This gives a² – 10a + 24 = 0. Factoring gives (a – 6)(a – 4)=0, so the two dimensions are 6 m and 4 m. Their product is 24 m² and twice their sum is 20 m, matching both original inputs exactly. For the general case, the same step is solved with the quadratic formula; OpenStax's quadratic-equations chapter explains the discriminant and real-root conditions used here.

How the rectangle dimensions formula works

Start with the perimeter equation and divide by two: a + b = P/2. Solve for one side, b = P/2 – a, and substitute that expression into A = ab. The result is a quadratic equation: a² – (P/2)a + A = 0. Its two roots are the rectangle's two side lengths.

Written directly, the sides are a = (P + √(P² – 16A))/4 and b = (P – √(P² – 16A))/4. The expression under the square root is the discriminant. If it is positive, there are two distinct positive side lengths; if it is zero, both sides equal P/4; if it is negative, no rectangle with real side lengths can satisfy both inputs.

Interpreting feasibility and measurement precision

For a fixed perimeter, the square encloses the greatest possible rectangular area. That is why A ≤ P²/16 is the key feasibility test. If field measurements are rounded, a pair that is only slightly inconsistent may fail this exact condition. In that situation, revisit the source measurements rather than forcing a result. The calculator keeps canonical precision internally and rounds only the displayed side lengths, so the downloaded workbook retains the current numeric values rather than copying formatted screen text.

The unit selector is a convenience conversion layer, not a change to the geometry. Area scales with the square of the length conversion factor, while perimeter and side lengths scale linearly. This distinction matters: converting 1 m to 100 cm means converting 1 m² to 10,000 cm², not 100 cm². Keeping area and perimeter in a consistent unit system is essential before applying the quadratic relationship.