Skip to content

Rectangle Calculator

Calculate a rectangle’s area, perimeter and diagonal from its length and width, plus its aspect ratio in lowest terms. Includes a square mode, a proportional labelled diagram, formula working and a custom unit label.

Calculators Runs client-side Free to use
Jump to the tool
Share: X WhatsApp
Loading Rectangle Calculator…

About the Rectangle Calculator

Rectangle Calculator takes a length and a width and returns the area, the perimeter, the diagonal and the shape’s proportions. The diagonal uses the Pythagorean theorem, √(length² + width²), and the working is shown with your numbers.

The aspect ratio is given in lowest whole-number terms when your sides have up to six decimal places (for example 1920 × 1080 becomes 16 : 9), alongside the decimal length-to-width ratio. Square mode uses one side for both dimensions. The diagram is drawn in proportion, and a text description is included for screen readers. Lengths use your unit label and the area uses the squared unit.

How to use

  1. Enter the length and the width, or tick Square mode and enter one side.
  2. Type a unit label and choose the decimal places to display.
  3. Press Calculate.
  4. Review the area, perimeter, diagonal, ratios, working and diagram.
  5. Copy or download the summary, or press Reset.

Key features

  • Area, perimeter and diagonal in one step.
  • Diagonal by the Pythagorean theorem with the formula shown.
  • Aspect ratio in lowest terms and decimal length-to-width ratio.
  • Square mode for equal sides.
  • Proportional labelled diagram with a text description.
  • Custom unit label with squared units for area.
  • Copy and download a plain-text summary.

Best practices

  • Measure both sides in the same unit before entering them.
  • Use the diagonal to check that a frame or layout is truly square-cornered.
  • Add a margin for waste when using area to buy materials.
  • Use the lowest-terms ratio for screens, images and print sizes.
  • Round the final result only.

Benefits

  • Covers the common rectangle measurements on one page.
  • Clear working for checking homework or plans.
  • Ratios make resizing images and layouts easier.
  • Private: runs entirely in your browser.

Frequently asked questions

How is the diagonal calculated?

With the Pythagorean theorem: diagonal = √(length² + width²). For a 3 × 4 rectangle that is √(9 + 16) = 5.

What is the difference between aspect ratio and length-to-width ratio?

They describe the same proportion. The aspect ratio is written as two whole numbers in lowest terms, such as 16 : 9; the length-to-width ratio is the single decimal value length ÷ width, such as 1.7778.

Why does the aspect ratio sometimes show only “≈ x : 1”?

A lowest-terms ratio is only exact when both sides have at most six decimal places. Otherwise the tool shows the decimal ratio instead of inventing a misleading whole-number one.

What does Square mode do?

It hides the width and uses the single side value for both length and width, so the area is side² and the diagonal is side × √2.

What values are accepted?

Positive numbers greater than zero up to 1,000,000,000. Empty, negative, zero and malformed values are rejected with a clear message.

Does the unit label convert anything?

No. The unit label is text only: it is attached to lengths, with ² for areas and ³ for volumes, so the results read correctly. Enter every measurement in the same unit. To change units, convert the inputs first, for example with the Unit Converter.

How accurate are the results?

The tool uses standard double-precision arithmetic (about 15–16 significant digits) and the full-precision value of π. Results are then rounded to the decimal places you choose, so the last shown digit is rounded and a value computed from rounded figures by hand can differ slightly. Very large or very small values are shown in exponent form.

Is anything I enter saved or sent anywhere?

No. Every calculation runs in your browser on your device. Inputs, settings and results are not uploaded and are not saved in browser storage. Reset clears them from the page.