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: .

Enter exactly two values and the rest is calculated. Clear a field to switch.
in square units, e.g. cm²
My ToolboxYour inputs are saved in this browser only.

Result

Sides
Length a = 8 cm, width b = 5 cm
Area
40 cm²
Perimeter
26 cm
Diagonal
9.43398 cm
Circumradius
4.71699 cm
Aspect ratio
1.6 : 1
Angle between the diagonals
64.0108° and 115.989°
Shape
Rectangle with unequal sides
Working
  • A = a · b = 8 · 5 = 40 cm²
  • p = 2 · (a + b) = 2 · (8 + 5) = 26 cm
  • d = √(a² + b²) = √(64 + 25) = 9.43398 cm
The labels a and b are interchangeable: when both sides are unknown, a is the longer one. Area is in square units; perimeter and diagonal are in the chosen unit.

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?

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