Last updated: August 1, 2026
Length and Width Given Area and Perimeter Calculator
Creators
Dharmendra SinghReviewers

Creators
Dharmendra SinghReviewers
Quick Answer
This calculator finds the length and width of a rectangle when area and perimeter are both known. It converts the geometry into a quadratic equation, checks whether the discriminant is valid, and returns the two side lengths together with the semi-perimeter used in the solution.
Given the area and perimeter, the rectangle length is {length} and the width is {width}.
Creators
Dharmendra SinghReviewers

Creators
Dharmendra SinghReviewers
Formula
If s = P/2, then length and width are the two roots of t² - st + A = 0, so length = (s + √(s² - 4A))/2 and width = (s - √(s² - 4A))/2.
Where:
- A=Rectangle area
- P=Rectangle perimeter
- s=Semi-perimeter
- l=Rectangle length
- w=Rectangle width
Worked Examples
Area 48 and perimeter 28
A classic 6-by-8 rectangle.
- 1Compute the semi-perimeter: s = 28/2 = 14.
- 2Evaluate the discriminant: s² - 4A = 14² - 4(48) = 4.
- 3Length = (14 + √4)/2 = 8 and width = (14 - √4)/2 = 6.
Area 50 and perimeter 30
Different side lengths still solve from the same quadratic.
- 1Find s = 30/2 = 15.
- 2Compute s² - 4A = 225 - 200 = 25.
- 3Length = (15 + 5)/2 = 10 and width = (15 - 5)/2 = 5.
Area 36 and perimeter 24
When the discriminant is zero, the rectangle is a square.
- 1s = 24/2 = 12.
- 2s² - 4A = 144 - 144 = 0.
- 3Both roots are 6, so the rectangle is actually a 6-by-6 square.
Area 81 and perimeter 36
Another perfect-square discriminant example.
- 1s = 18.
- 2s² - 4A = 324 - 324 = 0.
- 3Both dimensions equal 9.
Introduction
Use this calculator when the area and perimeter are both known but the two side lengths are missing. It solves the rectangle dimensions by treating length and width as the roots of a quadratic equation, so you get a deterministic answer whenever the measurements describe a real rectangle.
What information is required
Area alone is not enough to identify a unique rectangle because many different side pairs can share the same area. Adding the perimeter gives a second equation, which makes the side lengths solvable.
Area gives the product l × w.
Perimeter gives the sum l + w after halving.
Two independent equations are enough to solve for both unknown sides.
Why a quadratic equation appears
If s = P/2, then length and width satisfy l + w = s and lw = A. Substituting w = s - l into lw = A produces l² - sl + A = 0, and the two roots are the two side lengths.
Start with l + w = P/2.
Use lw = A.
Solve the resulting quadratic with the discriminant.
Validation rules
The discriminant s² - 4A must be non-negative. If it is negative, the stated area and perimeter cannot belong to any real rectangle.
Area must be greater than 0.
Perimeter must be greater than 0.
The relationship P² ≥ 16A must hold for a real rectangle.
The equality case P² = 16A produces a square.
How to interpret the outputs
The calculator always reports the larger root as the length and the smaller root as the width. Semi-perimeter is included because it is the quantity used directly in the quadratic formula.
Length is the longer side.
Width is the shorter side.
Semi-perimeter is a quick check on the input pair.
Common mistakes to avoid
Most errors come from mixing up area and perimeter or entering a perimeter that is too small for the chosen area.
Do not use half the perimeter as the full perimeter input.
Do not expect a solution when P² < 16A.
Keep units consistent across area and perimeter measurements.
Where this calculation is useful
This reverse-geometry setup appears in algebra courses, design checks, flooring estimates, and optimization problems where total border length and interior area are both constrained.
Solving classroom word problems.
Checking rectangular layout options.
Verifying dimension pairs before drafting or estimating.
FAQs
Why do I need both area and perimeter?
Area alone only gives the product of the sides. Perimeter adds the sum, which is what makes the pair of dimensions unique.
What does a negative discriminant mean?
It means the stated area and perimeter cannot produce any real rectangle, so there is no valid pair of side lengths.
Why is the equality case a square?
When s² - 4A = 0, the quadratic has one repeated root, so the two side lengths are equal.
Can the width ever be larger than the length?
The underlying math is symmetric, but this calculator labels the larger dimension as length and the smaller as width for consistency.
Do I need special units?
No. Any consistent unit system works as long as the area and perimeter belong to the same rectangle.
How can I quickly check the answer?
Multiply the reported length and width to recover the area, and add them then double to recover the perimeter.