StatGardenREF. DESK
Calculators/Geometry/Rectangle & square
Geometry

Rectangle & square calculator

Area, perimeter and diagonal.

What this calculator does

A rectangle is fixed by two measurements, length and width, and everything else about it follows directly: the area from their product, the perimeter from their sum doubled, and the diagonal from Pythagoras, since a diagonal cuts the rectangle into two right triangles.

A square is just the special case where length and width match, which is why this calculator handles both without a separate mode. Set the two sides equal and the diagonal, aspect ratio and everything else fall out correctly on their own.

The formula

FormulaA = l·w · P = 2(l+w) · d = √(l²+w²)

The diagonal treats the rectangle as two right triangles sharing a hypotenuse, so it is the length and width combined by Pythagoras rather than added directly. The aspect ratio is simply the longer side divided by the shorter, expressed against 1, which is how screens, paper and photo formats are usually described.

TermMeaning
l, wLength and width: the two independent measurements.
AArea, equal to l × w.
PPerimeter, the distance around all four sides, equal to 2(l + w).
dDiagonal, equal to √(l² + w²).
Aspect ratioThe longer side divided by the shorter, written as a ratio to 1.

The inputs explained

FieldWhat to enter
LengthThe longer or reference side.
WidthThe other side. Set it equal to the length for a square.

When to use it

Ordering materials by area

Flooring, turf, fabric and paint are all priced by area, so length times width is the number that actually matters, not either dimension alone.

Checking a screen or paper size

The aspect ratio here is the same figure printed on a spec sheet as 16∶9 or 4∶3: divide the longer side by the shorter and compare.

Confirming a frame is square, not just rectangular

A true rectangle has equal diagonals. If you can measure both diagonals on a door frame or garden bed and they differ, the corners are not right angles even if the sides look correct.

Fitting something on the diagonal

A board, mattress or screen that will not fit straight sometimes fits corner to corner: the diagonal is the true maximum length a rectangle can contain.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How area and diagonal grow as a rectangle lengthens

One side held at 6 while the other stretches out.

Width fixed at 6
LengthAreaDiagonalAspect ratio
848.00010.0001.333 : 1
1272.00013.4162.000 : 1
20120.00020.8813.333 : 1
30180.00030.5945.000 : 1
50300.00050.3598.333 : 1
At a length of 8 against a width of 6 the diagonal comes out to exactly 10: an 8-6-10 triangle, which is the 3-4-5 triple doubled. It is a quick way to check a rectangular frame is truly square using a tape alone.

Common aspect ratios at a fixed length of 16

The same length paired with a range of widths, spanning some widely used screen and paper proportions.

Length fixed at 16
WidthAreaDiagonalAspect ratio
9144.00018.3581.778 : 1
10160.00018.8681.600 : 1
12192.00020.0001.333 : 1
16256.00022.6271.000 : 1
20320.00025.6120.800 : 1
A 16 by 12 rectangle is the old 4∶3 television shape, and its diagonal lands on exactly 20: a 16-12-20 triangle, another multiple of 3-4-5. A 16 by 9 rectangle is today’s widescreen ratio, with an area of 144 and a diagonal of about 18.87.

Questions

How do I find the area of a rectangle?

Multiply length by width. Both measurements must be in the same unit, and the answer comes out in that unit squared: metres times metres gives square metres.

How is a square different from a rectangle in this calculator?

It is not, mathematically. Enter the same value for both length and width and every result, area, diagonal, aspect ratio, is correct for a square without any special handling.

How do I find the diagonal of a rectangle?

Square the length, square the width, add them, then take the square root: Pythagoras applied to the right triangle each diagonal forms with two sides.

What does an aspect ratio like 16∶9 actually mean?

It means the longer side is 16 units for every 9 of the shorter side, not that either side has a fixed size. A 16∶9 screen could be 16 cm or 16 metres across; only the proportion is fixed.

How can I check a rectangle is truly square-cornered?

Measure both diagonals. In a true rectangle they are always equal; if they differ, at least one corner is off a right angle, even though the sides may be the correct lengths.

For a diagonal between two arbitrary points rather than a rectangle’s corners, see the distance and midpoint calculator. For a three-dimensional box, use the rectangular prism calculator.