Area of a Rectangle Calculator

By: Calculator Grid

Rectangle calculator

Solve a rectangle from any supported pair of measurements, then compare its area, perimeter, diagonal, and side proportions in one consistent unit system.

Area 30 cm² Perimeter 22 cm Diagonal 7.81025 cm

Known measurements

Choose the two independent values you already know.

All linear results use this unit; area uses its square.

cm

cm

Live results

Area

30 cm²

Calculated from 5 cm × 6 cm.

Length (a)

5 cm

Width (b)

6 cm

Perimeter (P)

22 cm

Diagonal (d)

7.81025 cm

Aspect ratio

1.2:1

Area 30 square centimeters; perimeter 22 centimeters; diagonal 7.81025 centimeters.

Measurement details

Measurement Formula or identity Result Unit
Length (a) Known side 5 cm
Width (b) Known side 6 cm
Area (A) A = a × b 30 cm²
Perimeter (P) P = 2 × (a + b) 22 cm
Diagonal (d) d = √(a² + b²) 7.81025 cm
Aspect ratio longer side ÷ shorter side 1.2 ratio
Area is expressed in square units. Every other geometric length is expressed in the selected linear unit. The table and Excel workbook use the same unrounded canonical calculation.

How to use the rectangle calculator

What this calculator does

This calculator solves the five standard measurements of a Euclidean rectangle: Length (a), Width (b), Area (A), Perimeter (P), and Diagonal (d). It accepts any supported pair of independent measurements and derives the remaining values from rectangle identities. It is useful for dimension checks and quantity planning, but it does not account for material waste, kerf, seams, border allowances, thickness, irregular corners, or measurement uncertainty.

When to use it

Use it to estimate floor covering from room dimensions, determine trim or fencing from a rectangular boundary, verify a screen or frame diagonal, or recover unknown side lengths from an area and perimeter. The underlying formulas follow the standard distinction between linear perimeter and square-unit area described in the OpenStax treatment of area.

How to calculate

  1. The calculator opens with a complete demonstration: Length + Width, 5 cm, and 6 cm. Its results and a validated example Excel workbook are available immediately.
  2. Choose Known measurements. This determines what the two value fields mean. When a valid rectangle is already displayed, changing the pair carries the current rectangle into the new pair rather than changing the geometry.
  3. Choose the Measurement unit. Existing valid input values are converted, not merely relabeled. Linear measurements use the chosen unit; area uses the corresponding square unit.
  4. Replace First known value and Second known value with positive decimals. A period is the decimal separator. Standard U.S. thousands grouping such as 1,250.5 is accepted; decimal-comma and scientific notation are rejected to prevent ambiguous interpretation.
  5. Read the live Area, Length (a), Width (b), Perimeter (P), Diagonal (d), and Aspect ratio. Download Excel exports the current validated inputs and canonical results. Reset clears the demonstration and calculated state; Excel export remains disabled until two complete, compatible values are entered again.

Input guide

Known measurements is required and selects one of ten equation pairs. Length + Width is the direct case. Pairs that include Area, Perimeter, or Diagonal solve algebraically. For pairs such as Area + Perimeter, two side roots are interchangeable, so the calculator assigns the larger root to Length and the smaller root to Width. A common mistake is entering values that cannot describe a real rectangle – for example, a diagonal shorter than a known side or an area larger than a given perimeter can enclose.

Measurement unit is required. Choose mm, cm, m, km, in, ft, or yd. A value such as 2.5 m is entered as 2.5 while the unit appears beside the field. Keep both known measurements in the displayed unit system. NIST recommends expressing dimensions in one common unit before applying geometric formulas; its area and measurement guidance explains why the resulting area carries a squared unit.

First known value and Second known value are required positive numbers. Their dynamic sublabels identify the selected measurements and their unit adornments show whether a linear or square value is expected. Example inputs are 5 for Length and 6 for Width in centimeters. Increasing either side increases area, perimeter, and diagonal. Increasing a derived constraint such as area may or may not increase both sides because the second known measurement still limits the solution.

Output guide

Area measures enclosed surface in square units and is an exact identity from the solved sides. Perimeter (P) measures total boundary length. Diagonal (d) is the straight-line distance between opposite corners and follows the Pythagorean theorem. Length (a) and Width (b) are the solved adjacent sides; neither label guarantees that one is physically horizontal or longer unless an ambiguous pair requires a convention. Aspect ratio is the longer side divided by the shorter side, so 1:1 is a square and larger values indicate a more elongated rectangle. The measurement table repeats each result with its formula and unit; a zero or negative result is never considered a valid rectangle.

Worked example

With Length = 5 cm and Width = 6 cm, area is 5 × 6 = 30 cm². Perimeter is 2 × (5 + 6) = 22 cm. Diagonal is √(5² + 6²) = √61 = 7.81025 cm at the displayed precision. The longer-to-shorter aspect ratio is 6 ÷ 5 = 1.2:1. These are the same values shown on first open and written to the startup Excel workbook.

Rectangle formulas and compatibility checks

A = a × b P = 2(a + b) d = √(a² + b²)

The direct formulas are straightforward when both sides are known. Reverse-solving requires additional checks. If one side and the perimeter are known, half the perimeter must exceed that side. If one side and the diagonal are known, the diagonal must be longer than the side. With area and perimeter, the quadratic discriminant must be nonnegative; this is another way of saying the requested area cannot exceed the area of the square having that perimeter.

With area and diagonal, a real rectangle requires d² ≥ 2A. Equality produces a square. With perimeter and diagonal, the diagonal must lie between P/(2√2) and P/2: the lower boundary is a square, while approaching the upper boundary makes one side approach zero. The calculator reports incompatible combinations rather than forcing an imaginary, zero, or negative side.

Area, perimeter, and diagonal answer different questions

Area is appropriate for flooring, paint coverage on a flat panel, fabric, glass, turf, or tile. Perimeter is appropriate for trim, edging, fencing, cable runs around a boundary, or a frame. Diagonal is useful for checking squareness during layout and for comparing rectangular displays, but a diagonal alone does not determine a unique rectangle. OpenStax summarizes the standard rectangle perimeter and area identities in its geometric formulas reference.

Practical measurement note: Real objects are rarely perfect mathematical rectangles. Measure each side in more than one place when accuracy matters, and add an application-specific allowance only after calculating the ideal geometric quantity.

Common mistakes

  • Mixing units, such as entering one side in feet and the other in inches without conversion.
  • Reporting area in linear units instead of square units.
  • Treating the diagonal as a substitute for both side lengths.
  • Assuming the labels Length and Width prove which side is longer; they are simply adjacent-side names.
  • Rounding intermediate values too early. This calculator keeps canonical precision and rounds only for display.