Last updated: July 31, 2026
Dimensions of Rectangle Calculator
Creators
Dharmendra SinghReviewers

Creators
Dharmendra SinghReviewers
Creators
Dharmendra SinghReviewers

Creators
Dharmendra SinghReviewers
Formula
x^2 - (P/2)x + A = 0, where roots are length and width
Where:
- A=Area
- P=Perimeter
- x=Rectangle Side (Length or Width)
Worked Examples
Rectangle 12 × 8
Recover side lengths from A = 96 and P = 40.
- 1x^2 - (40/2)x + 96 = 0
- 2x^2 - 20x + 96 = 0
- 3(x - 12)(x - 8) = 0
Square case
A = 16 and P = 16 should return identical sides.
- 1x^2 - 8x + 16 = 0
- 2(x - 4)^2 = 0
- 3Both dimensions equal 4
Longer rectangle
Use A = 75 and P = 40.
- 1x^2 - 20x + 75 = 0
- 2Discriminant = 20^2 - 4×75 = 100
- 3x = (20 ± 10)/2 → 15 and 5
No real rectangle
A = 100 and P = 10 is geometrically impossible.
- 1x^2 - 5x + 100 = 0
- 2Discriminant = 25 - 400 = -375
- 3Negative discriminant means no real dimensions
Introduction
This Dimensions of Rectangle Calculator solves for unknown side lengths when area and perimeter are known. It converts the geometry constraints into a quadratic equation and returns the two real roots as length and width.
Core Rectangle Equations
A rectangle is governed by two equations: A = l×w and P = 2(l+w). Combining them lets us solve both unknown sides.
- Area equation:
A = l×w
- Perimeter equation:
P = 2(l+w)
- Half perimeter:
l + w = P/2
Substitute to build one quadratic
Quadratic Derivation
If one side is x, the other is (P/2 - x). Multiply them to get area: x(P/2 - x)=A, then rearrange to x^2 - (P/2)x + A = 0.
Start with x + y = P/2
Set y = P/2 - x
Use xy = A
Solve x^2 - (P/2)x + A = 0
When Inputs Are Valid
A real rectangle exists only if the quadratic discriminant is nonnegative and both roots are positive.
Discriminant D = (P/2)^2 - 4A
Need D ≥ 0 for real roots
Need width > 0 and length > 0
Otherwise geometry is impossible
How to Use the Calculator
Provide area and perimeter in consistent units, then read the computed length and width.
Enter area value
Enter perimeter value
Review returned length and width
Check error message for impossible pairs
Units and Scaling
The calculator is unit-agnostic as long as inputs are consistent: area in square units and perimeter in the corresponding linear units.
m² requires perimeter in m
ft² requires perimeter in ft
Do not mix unit systems
Outputs use the same linear unit as perimeter
Practical Applications
Reverse-solving dimensions is useful in floor planning, fabrication, fencing, and layout optimization.
Room and tile planning
Packaging and sheet cutting
Land parcel estimation
Material and border calculations
Quick Input Pattern Guide
These common patterns help you sanity-check your expectations before finalizing dimensions.
| Input Pattern | Expected Outcome |
|---|---|
| D > 0 | Two distinct positive sides |
| D = 0 | Square (equal sides) |
| D < 0 | No real rectangle |
| A ≤ 0 or P ≤ 0 | Invalid input |
FAQs
What inputs does this calculator need?
It needs area and perimeter. From those two values, it computes the rectangle's length and width.
Why does the method use a quadratic equation?
Because area is the product of two unknown sides while perimeter gives their sum. Product-and-sum systems naturally reduce to a quadratic.
What does a 'no real rectangle' result mean?
It means your area and perimeter pair cannot occur together for any real positive length and width.
Can this calculator return a square?
Yes. When the discriminant is zero, both roots are equal, so the rectangle is a square.
Do I need to enter units?
No explicit unit entry is required, but your area and perimeter must be in compatible units.
How are decimal inputs handled?
Decimal area and perimeter values are supported and outputs are rounded to six decimal places.
Which side is reported as length and width?
The larger root is reported as length and the smaller positive root as width.