Skip to content

Rectangle calculator

Enter the length and width to find area, perimeter, and corner-to-corner diagonal.

Enter the dimensions

Your data stays in this browser.

LengthWidthd

Results

Your results will appear here

Enter two positive dimensions, then select Calculate or press Enter.

How to use the rectangle calculator

Enter length and width

Measure two adjacent sides in the same unit. Choose that unit, enter both positive values, and select Calculate. Changing either dimension clears the old result so it cannot be mistaken for the new measurement; Clear removes inputs and results but keeps the selected unit.

Area: surface inside the rectangle

Area is length × width. The answer therefore uses square units: centimetres become cm², metres become m², and so on. Use area for a floor, tabletop, sheet, wall, or other flat rectangular surface.

Perimeter: distance around the edge

Perimeter is 2 × (length + width). It uses the original linear unit and is useful for trim, edging, frames, or fencing. This is the combined length of all four sides, not the surface covered.

Diagonal: corner-to-corner distance

The diagonal is √(length² + width²), from the Pythagorean theorem. It is the straight line between opposite corners and can help check whether an object or screen fits through a rectangular opening.

Worked examples

A 3 m by 4 m rectangle

Area = 3 × 4 = 12 m². Perimeter = 2 × (3 + 4) = 14 m. Diagonal = √(3² + 4²) = 5 m.

A 5 cm square

Enter 5 for both dimensions. Area = 25 cm², perimeter = 20 cm, and diagonal = √50 ≈ 7.07 cm. No separate square mode is needed.

Limits and error checks

Both fields are required and must contain positive finite numbers. Do not include unit symbols, fractions, formulas, or thousands separators. Ordinary results are rounded for display only; if a measurement is safety-critical, verify the source dimensions and use appropriate professional tolerances.

Frequently asked questions

Can I calculate a square?

Yes. A square is a rectangle with equal sides, so enter the same positive value for length and width.

Why is area shown in square units?

Area multiplies two lengths. For example, metres × metres produces square metres (m²).

Does the unit selector convert measurements?

No. It labels the dimensions and results. Enter length and width in the same selected unit.

Why did my result disappear after editing?

An edited dimension makes the previous answer stale, so the calculator clears it until you calculate again.