geometry calculators

Rectangle and Square Calculator

Compute the area, perimeter, diagonal, or aspect ratio of any rectangle or square by entering its length and width. Useful for room planning, material estimation, and screen sizing.

About this calculator

A rectangle is defined by its length (l) and width (w). Four properties are commonly needed: Area = l × w (the space inside the rectangle), Perimeter = 2(l + w) (the total boundary length), Diagonal = √(l² + w²) (derived from the Pythagorean theorem, since the diagonal divides the rectangle into two right triangles), and Aspect Ratio = l / w (the proportional relationship between the two dimensions). For a square, length and width are equal, so Area = l², Perimeter = 4l, and Diagonal = l√2. These formulas are foundational in architecture, interior design, screen resolution analysis, and everyday measurement tasks. The diagonal formula is particularly useful when you need to fit a rectangle through a doorway or determine monitor screen size.

How to use

Imagine a room that is 8 meters long and 5 meters wide. Area = 8 × 5 = 40 m² (useful for flooring). Perimeter = 2 × (8 + 5) = 2 × 13 = 26 m (useful for skirting boards). Diagonal = √(8² + 5²) = √(64 + 25) = √89 ≈ 9.43 m (useful for checking squareness). Aspect ratio = 8 / 5 = 1.6. Enter 8 as the length, 5 as the width, select 'Rectangle' as the shape type, and choose your desired calculation type from the dropdown.

Frequently asked questions

How do I calculate the diagonal of a rectangle using its length and width?

Use the Pythagorean theorem: Diagonal = √(length² + width²). This works because the diagonal of a rectangle forms the hypotenuse of a right triangle whose legs are the length and width. For a 6 × 8 rectangle, the diagonal = √(36 + 64) = √100 = 10 units. Knowing the diagonal is essential in construction for checking whether corners are truly square — if the diagonal matches the formula, the rectangle is perfectly right-angled.

What is the difference between the area and perimeter of a rectangle?

Area measures the two-dimensional surface enclosed by the rectangle (Area = length × width), expressed in square units such as m² or ft². Perimeter measures the total length of the rectangle's boundary (Perimeter = 2 × (length + width)), expressed in linear units. You use area when calculating how much paint, carpet, or tiles you need, and perimeter when calculating how much fencing, trim, or framing material is required.

How is calculating a square different from calculating a rectangle?

A square is a special rectangle where length equals width. This simplifies the formulas: Area = side², Perimeter = 4 × side, and Diagonal = side × √2. In this calculator, selecting 'Square' means only the length field is used — the width is automatically set equal to it. All the same output options (area, perimeter, diagonal, aspect ratio) remain available, and the aspect ratio of a perfect square is always 1.