Dimensions of a Rectangle Calculator

This calculator works out the length and width of a rectangle when you already know some combination of its area, perimeter or a single side, but not both dimensions outright. Choose which two values you have: area and perimeter, area and one known side, or perimeter and one known side, then enter those figures along with a unit label such as metres, centimetres, feet or a generic unit, used for display only. When you supply area and perimeter, the calculator forms the half-perimeter and solves the resulting quadratic equation, since the length and width are its two roots. When you supply one side plus the area or perimeter, it rearranges the standard formulas directly, needing no quadratic step. Results show the calculated length and width, plus an area and perimeter check confirming these dimensions reproduce the figures you entered. A method panel breaks down the half-perimeter, discriminant and equation solved, alongside the resulting diagonal and aspect ratio of the rectangle. If the area and perimeter you enter cannot belong to any real rectangle, the calculator flags this clearly rather than returning a misleading answer. Keep your units consistent throughout, using square units for area that match the linear unit used for perimeter or side length, and the tool handles the algebra for you, whether you are checking a section plan, a fencing job or a maths problem.

Calculate.co.nz is proud to be partnered with Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner: Health Based Building
Method verified  Standard rectangle area and perimeter formulas: A = L x W, P = 2(L + W).

1. What You Know

2. Units

Enter area in square units matching your chosen unit (for example square metres if using metres) and perimeter or side length in the same linear unit.

Rectangle Dimensions

Length
5 m
Longer side
Width
4 m
Shorter side
Area (check)
20 m2
Length x Width
Perimeter (check)
18 m
2 x (Length + Width)

Method Used

ModeArea and perimeter
Half perimeter (s = P/2)9 m
Discriminant (s^2 - 4A)1
Equation solvedx^2 - 9x + 20 = 0
ResultL = 5, W = 4

Rectangle Properties

Length5 m
Width4 m
Diagonal (sqrt(L^2 + W^2))6.4 m
Aspect ratio (L:W)1.25 : 1
Summary: Enter your known values above.

How to Find the Dimensions of a Rectangle

A rectangle has two pairs of equal sides: a length (the longer side) and a width (the shorter side). If you already know both dimensions, working out the area and perimeter is straightforward. This calculator solves the reverse problem: working backwards from the area, perimeter, or one known side to find both dimensions.

Method 1: Area and Perimeter Known

This is the classic version of the problem and it uses a quadratic equation. If the area is A and the perimeter is P:

  1. Find the half-perimeter: s = P / 2. Since P = 2(L + W), this means s = L + W.
  2. You now know that L + W = s and L x W = A. These are the sum and product of the two dimensions.
  3. Both dimensions are roots of the quadratic equation x^2 - s*x + A = 0.
  4. Solve using the quadratic formula: x = (s +/- sqrt(s^2 - 4A)) / 2.
  5. The larger root is the length, and the smaller root is the width.

For example, if the area is 20 and the perimeter is 18: s = 9, and the discriminant is 9^2 - 4(20) = 81 - 80 = 1. So x = (9 +/- 1) / 2, giving x = 5 or x = 4. The rectangle is 5 by 4.

Method 2: Area and One Side Known

If you already know one side (say the length, L) and the area (A), the other side is found directly by rearranging the area formula:

Width = Area / Length

No quadratic equation is required because you already have one of the two unknowns.

Method 3: Perimeter and One Side Known

If you know the perimeter (P) and one side (say the length, L), the other side comes from rearranging the perimeter formula P = 2(L + W):

Width = (Perimeter / 2) - Length

When There Is No Valid Rectangle

When solving from area and perimeter, the discriminant (s^2 - 4A) must be zero or positive for a real rectangle to exist. If it is negative, the perimeter given is too small to enclose that much area, and no real rectangle satisfies both values. If the discriminant is exactly zero, the two roots are equal, meaning the rectangle is actually a square.

Related Calculators

Method: Standard Euclidean geometry formulas for rectangles: Area = Length x Width, Perimeter = 2 x (Length + Width). The area-and-perimeter case is solved using the quadratic formula applied to the sum and product of the two dimensions.

This calculator assumes a true rectangle (opposite sides equal, all angles 90 degrees). Results are given to two decimal places. Always check that your inputs use consistent units (for example, square metres for area with metres for perimeter or side length).