Rectangle Calculator

Find area, perimeter, and diagonal of a rectangle

By Drew Budwin · Last updated July 2026 · Methodology

Must be greater than 0

Must be greater than 0

Embed this calculator

Add it to your website or blog

Embed this calculator

Theme

Paste this code into your website's HTML where you want the calculator to appear. It adds a small credit link back to CalcTray. Please keep it. How embedding works.

Optional: auto-resize iframe to fit content

Add this snippet to your page so the iframe height adjusts automatically after each calculation:

Rectangle Calculator Formula

Area of a rectangle:

A = length × width

Perimeter of a rectangle:

P = 2 × (length + width)

Diagonal of a rectangle:

d = √(length² + width²)

How to Use This Calculator

  1. Enter the length of the rectangle.
  2. Enter the width of the rectangle.
  3. Click Calculate to see area, perimeter, and diagonal.
  4. Share your result by copying the URL that updates automatically after calculating.

Frequently Asked Questions

What is the formula for the area of a rectangle?

The area of a rectangle is A = length × width. This equals the number of unit squares that fit inside the shape. For example, a rectangle 10 meters long and 5 meters wide has an area of 50 square meters.

How do you find the perimeter of a rectangle?

The perimeter is the total distance around the outside: P = 2 × (length + width). Unlike area, perimeter is measured in linear units (meters, feet), not square units.

What is the diagonal of a rectangle?

The diagonal connects two opposite corners and is calculated using the Pythagorean theorem: d = √(length² + width²). If you need to calculate angles of the diagonal, use the Pythagorean theorem calculator.

What units are used?

This calculator is unit-agnostic. If you enter measurements in feet, area is in square feet, perimeter in feet, and diagonal in feet. Just be consistent with your units. To convert area units, use the area converter.

Is a square a rectangle?

Yes. A square is a special rectangle where all four sides are equal. The area formula A = length × width still applies — for a square, it becomes A = s². Similarly, the diagonal of a square simplifies to d = s × √2.

How do I calculate the area of an L-shaped room?

Split the L into two rectangles, calculate each area separately, and add them. Measure where the notch is to find the two sets of dimensions. This calculator handles each rectangle individually.

Is there a rectangle with the maximum area for a fixed perimeter?

Yes: a square. Among all rectangles with the same perimeter, the square encloses the most area. A perimeter of 20 m gives maximum area when length = width = 5 m (25 m²), more than a 3 × 7 rectangle (21 m²).

How does rounding affect real-world area measurements?

Small rounding compounds in area. A room measured as 3.97 m × 5.02 m has an area of about 19.93 m² — 4% less than the round 4 × 5 = 20 m² figure. For flooring or paint, measure to the nearest centimeter and add a 10% waste margin.

Further Reading

Related Calculators