What this rectangle calculator does
This tool solves every defining property of a rectangle from any valid pair of known values. A rectangle is described by two side lengths — a (length) and b (width) — and three derived quantities: the area A, the perimeter P, and the two equal diagonals \(p = q\). Give the calculator one side plus one more value (the other side, the area, the perimeter or a diagonal) and it returns all five results at once. When the two sides are equal the rectangle is simply a square.
How to use it
Pick a calculation mode that matches what you already know, type the two required positive numbers, then choose an optional length unit and how many significant figures to display. Only the input fields relevant to your chosen mode appear. All entries must be numbers greater than zero.
The formulas explained
The three core relations are $$A = a \cdot b,\quad P = 2(a + b),\quad p = q = \sqrt{a^2 + b^2}$$ The diagonal comes straight from the Pythagorean theorem because the two sides and a diagonal form a right triangle. When you provide the area, the missing side is found by division (\(b = A / a\)). When you provide a perimeter, the missing side is \(b = P/2 - a\). When you provide a diagonal, the missing side is \(b = \sqrt{p^2 - a^2}\).
Worked example
Suppose you know the perimeter \(P = 20\) and one side \(a = 6\). First find the other side: $$b = P/2 - a = 10 - 6 = 4$$ Then the area $$A = 6 \times 4 = 24,$$ and the diagonal $$p = \sqrt{6^2 + 4^2} = \sqrt{52} \approx 7.2111$$ So \(a = 6\), \(b = 4\), \(P = 20\), \(A = 24\) and \(p = q \approx 7.2111\).
FAQ
Why must the diagonal be longer than each side? The diagonal is the hypotenuse of a right triangle formed by the two sides, so it is always strictly longer than either side; if you enter a diagonal that is not, the rectangle is impossible.
Does the unit change the numbers? No. The calculator works in one consistent unit you supply, so the unit only labels the answers. Linear results carry the unit; the area carries the unit squared.
Can a and b be equal? Yes — that gives a square, which is a valid special case of a rectangle.