Rectangle Length, Width & Area Calculator
Enter any two of the four rectangle measurements — length, width, area, or perimeter — and the calculator fills in the rest, including the diagonal.
sq units
units
Length × Width
- 1
Area = length × width
8 × 5 = 40 - 2
Perimeter = 2 × (l + w)
2 × (8 + 5) = 26
How does this calculator work?
Enter any two of length, width, area, or perimeter to solve the rectangle. Key formulas: A = l × w, P = 2(l + w), d = √(l² + w²). When only area and perimeter are known, the solver finds dimensions from t² − (P/2)t + A = 0.
Formula
How this is calculated
A rectangle is completely determined by any two independent measurements. If both sides are given, area and perimeter follow from A = l × w and P = 2(l + w). If one side and the area are given, the other side is l = A / w. If one side and the perimeter are given, use l = P/2 − w. The most constrained case — area and perimeter only — requires solving the quadratic t² − (P/2)t + A = 0, whose two roots are the length and width (the system l + w = P/2 and l × w = A is equivalent). The discriminant (P/2)² − 4A must be non-negative; if it is negative, no real rectangle satisfies those measurements.
The diagonal length is derived from the Pythagorean theorem d = √(l² + w²), since a diagonal cuts the rectangle into two congruent right triangles.
The result labels the larger dimension as "length" by convention. Leave the fields you do not know blank (clear them completely); the solver reads whichever two are filled.
Frequently asked questions
Any two of the four: (l, w), (l, A), (l, P), (w, A), (w, P), or (A, P). With only A and P the calculator solves a quadratic — if the discriminant is negative, those values are geometrically impossible.
A diagonal divides a rectangle into two right triangles. By the Pythagorean theorem, d = √(l² + w²).
The formulas are symmetric in l and w; labelling the larger result as "length" is only a display convention and does not affect the computed values.
Also known as
TG we-Calculate Editorial Team. (2026). Rectangle Length, Width & Area Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/length-width-area-rectangle-calculator
TG we-Calculate Editorial Team. "Rectangle Length, Width & Area Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/length-width-area-rectangle-calculator.
TG we-Calculate Editorial Team, "Rectangle Length, Width & Area Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/length-width-area-rectangle-calculator
@misc{wecalculate_length_width_area_rectangle_calculator, title = {Rectangle Length, Width & Area Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/length-width-area-rectangle-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
