Rectangle Calculator
This rectangle calculator needs just two values of your choice – for example length and width, one side and the diagonal, or area and perimeter – and fills in every other measurement right away, with the working shown.
Source: Wikipedia – Rectangle (area, perimeter, diagonal, circumscribed circle). Updated: .
How it is calculated
Any two measurements of a rectangle give you the rest: area A = a × b, perimeter P = 2 × (a + b) and diagonal d = √(a² + b²). The calculator rearranges these formulas when length and width are not the values you know.
Which pairs work?
- Length and width: plug straight in.
- One side and the area: the other side is area ÷ side.
- One side and the diagonal: the Pythagorean theorem gives b = √(d² − a²).
- One side and the perimeter: b = P ÷ 2 − a.
- Area and perimeter: a and b solve the quadratic x² − (P ÷ 2)·x + A = 0. They exist only if the perimeter is at least 4·√A – for a given area the square has the smallest perimeter.
- Area and diagonal or diagonal and perimeter: both lead to a + b and a − b and therefore to unique sides.
Good to know
The diagonals of a rectangle are equal and bisect each other; where they cross is the center of the circumscribed circle, whose radius is d ÷ 2. In a square they meet at right angles. If you need a right triangle, use the Pythagorean theorem calculator or the triangle calculator; for floor areas there is the square footage calculator.
Frequently asked questions
How do you calculate a rectangle?
With length a and width b: area A = a × b, perimeter P = 2 × (a + b), diagonal d = √(a² + b²). If one side is missing it follows from any other value, for example the area divided by the known side.
How do I find the sides from area and perimeter?
Solve x² − (P ÷ 2)·x + A = 0. For example A = 40 and P = 26 give sides 8 and 5. If the perimeter is below 4·√A, no rectangle exists.
How long is the diagonal of a rectangle?
By the Pythagorean theorem d = √(a² + b²). For 8 by 5 that is √89 ≈ 9.434. The diagonal is always longer than either side.
What is the difference between a rectangle and a square?
A square is a rectangle with four equal sides. The calculator recognizes it and shows an aspect ratio of 1 : 1; its diagonals cross at a right angle.
Why can I only enter two values?
Two independent measurements fix a rectangle completely. Any further value would be either redundant or contradictory, so the calculator asks for exactly two.
Sources and legal basis
As of: · Editorial policy
Related tools
- Circumference CalculatorCircumference calculator that also gives perimeter and area of a circle, rectangle, square, ellipse, triangle, trapezoid, parallelogram or polygon.
- Triangle CalculatorTriangle calculator from any three values (SSS, SAS, ASA, AAS, SSA): missing sides and angles, area, perimeter, heights, inradius and circumradius.
- Pythagorean Theorem CalculatorPythagorean theorem calculator: enter two sides to get the third side, both angles, area and height – with exact square roots, working and a right-angle check.
- Square Footage CalculatorSquare footage calculator for rooms and whole homes: enter feet and inches or metres, add rooms and L-shapes, get sq ft, m², sq yd, acres, waste and cost.
- Online CalculatorCalculator online, free and instant: type or tap and see the answer as you go – order of operations, brackets, percent, square root, steps and a history list.
- Pneumatic cylinder force calculator with load factor and air consumptionPneumatic cylinder force calculator: extend and retract force from bore, rod and pressure, usable load with SMC load factor, minimum bore and air consumption.
- Mixing Temperature CalculatorMixing temperature calculator using Richmann’s rule for water and other materials, plus bath water: how much hot and cold water for a target temperature.
- Spur gear calculator: pitch, tip and root diameter from module and teethSpur gear calculator: reference, tip, root and base diameter, tooth depth, circular pitch and center distance from module and teeth – or the teeth from a.
- Lens equation calculatorLens equation calculator: image distance, object distance or focal length from two values, with magnification and image type for convex and concave lenses.