Rectangle Calculator: Area, Perimeter, Diagonal and Sides from Any Two Values
Solve a rectangle from any two of length, width, area, perimeter and diagonal: get the missing sides, area, perimeter, diagonal, angles and aspect ratio with steps.
How it works
Area A = l × w · Perimeter P = 2(l + w) · Diagonal d = √(l² + w²) · Circumradius R = d ÷ 2 · From area and perimeter: l, w = (P ± √(P² − 16A)) ÷ 4 · From area and diagonal: l + w = √(d² + 2A), l − w = √(d² − 2A) · From perimeter and diagonal: l − w = √(2d² − P²/4)
A rectangle has four right angles, so two numbers fix it completely. With both sides known, the area is length × width, the perimeter is twice their sum and the diagonal follows from the Pythagorean theorem. With one side and the area, perimeter or diagonal, the other side comes straight from rearranging those formulas. The harder cases use no side at all. Area and perimeter give the sum (P ÷ 2) and the product (A) of the two sides, so the sides are the two roots of x² − (P/2)x + A = 0. Area and diagonal give (l + w)² = d² + 2A and (l − w)² = d² − 2A; perimeter and diagonal give (l − w)² = 2d² − (P/2)². Not every pair works: a square is the extreme case, so the perimeter must be at least 4√A and the area at most d² ÷ 2. The calculator tells you when your numbers break these limits. It also reports the circumscribed circle (radius = half the diagonal), the aspect ratio, the angle the diagonal makes with the long side and the angles where the diagonals cross. Pick a unit to label the answers; the arithmetic is the same in any unit. Unlike the general area and perimeter calculators, which only go from sides to answers, this page solves the rectangle backwards from whichever two values you have.
Worked example
A rectangle 8 cm long and 6 cm wide: area = 8 × 6 = 48 cm²; perimeter = 2 × (8 + 6) = 28 cm; diagonal = √(64 + 36) = √100 = 10 cm, so the circumscribed circle has radius 5 cm. The aspect ratio is 4 : 3 (1.333 : 1), the diagonal makes arctan(6 ÷ 8) = 36.87° with the long side, and the diagonals cross at 73.74° and 106.26°. Going backwards from area 48 and perimeter 28: the sides solve x² − 14x + 48 = 0, giving x = (14 ± 2) ÷ 2 = 8 and 6.
Sources: CalculatorSoup: Rectangle calculator (solve from two known values) · Omni Calculator: Rectangle (5 × 6 cm worked example) · Math is Fun: Rectangle (12 × 5 perimeter and diagonal examples) · Wikipedia: Rectangle
Frequently asked questions
How do I find the width if I know the area and the length?
Divide the area by the length: w = A ÷ l. A 48 m² room that is 8 m long is 6 m wide.
How do I find the sides from the area and the perimeter?
Half the perimeter is l + w and the area is l × w, so the sides are the roots of x² − (P/2)x + A = 0, or l, w = (P ± √(P² − 16A)) ÷ 4. For A = 48 and P = 28: (28 ± √(784 − 768)) ÷ 4 = (28 ± 4) ÷ 4, so 8 and 6.
How do I calculate the diagonal of a rectangle?
Use the Pythagorean theorem: d = √(length² + width²). A 12 × 5 rectangle has a diagonal of √(144 + 25) = √169 = 13.
Is a square a rectangle?
Yes. A square is a rectangle whose four sides are equal. For a fixed perimeter it has the largest area of any rectangle, and for a fixed area it has the shortest perimeter.
Why does the calculator say no rectangle exists?
Some pairs are impossible. The perimeter can never be less than 4 × √area, the area can never exceed diagonal² ÷ 2, and half the perimeter must be longer than the diagonal (but no more than √2 × the diagonal). Each limit is reached by a square.
What is the aspect ratio of a rectangle?
The long side divided by the short side, often written as a ratio like 16 : 9 or 4 : 3. An 8 × 6 rectangle has an aspect ratio of 4 : 3, or 1.333 : 1.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.