Rectangle Calculator

Calculate area, perimeter, and diagonal length of any rectangle.

▭ Rectangle Calculator
Length (l)
units
Width (w)
units
Area
l × w
Perimeter
2 × (l + w)
Diagonal
√(l² + w²)

What is a Rectangle?

A rectangle is a four-sided polygon (quadrilateral) in which all four interior angles are right angles (90°). Its opposite sides are equal in length and parallel to each other. The two distinct side lengths of a rectangle are typically referred to as the length (the longer side) and the width (the shorter side), though mathematically there is no strict requirement that one be longer than the other.

Rectangles are among the most commonly encountered shapes in everyday life. Doors, windows, screens, books, tables, rooms, fields, and city blocks are all typically rectangular. The prevalence of rectangles in architecture and manufacturing is no accident - right angles are easy to construct, simple to measure, and allow objects to be stacked, tiled, and arranged efficiently without wasted space.

The three most important measurements of a rectangle are its area, perimeter, and diagonal. The area tells you how much two-dimensional space it occupies. The perimeter gives the total length of its boundary. The diagonal - the line connecting opposite corners - is found using the Pythagorean theorem, because the diagonal, along with two sides, forms a right triangle inside the rectangle.

A rectangle where all four sides are equal is called a square, making the square a special case of a rectangle. Every square is a rectangle, but not every rectangle is a square. This hierarchical relationship means all formulas derived for rectangles apply equally to squares, with the additional constraint that length equals width.

Understanding rectangle geometry is essential in fields ranging from interior design and construction to computer graphics and image processing, where screen resolutions and image dimensions are always described as rectangular arrays of pixels.

Formula

Area of a Rectangle:

A = l × w
A = Area (square units)
l = Length
w = Width

Perimeter of a Rectangle:

P = 2 × (l + w)
P = Perimeter (units)

Diagonal of a Rectangle:

d = √(l² + w²)
d = Diagonal length (units, from the Pythagorean theorem)

How to Use This Calculator

  1. Enter the length of your rectangle in the first input field. Use any consistent unit (cm, m, inches, feet).
  2. Enter the width in the second field. Both length and width must use the same unit.
  3. Click Calculate to compute area, perimeter, and diagonal simultaneously.
  4. Read the results - each card shows the formula used for transparency. Area is in square units, while perimeter and diagonal are in the same linear unit as your inputs.
  5. Try different dimensions - change either value and recalculate to explore how the measurements change.

Example Calculations

Example 1 - Room Floor Area

A bedroom is 4.5 m long and 3.2 m wide. Find its floor area, skirting board length (perimeter), and corner-to-corner diagonal.

1
l = 4.5 m, w = 3.2 m
2
Area = 4.5 × 3.2 = 14.4 m²
3
Perimeter = 2 × (4.5 + 3.2) = 2 × 7.7 = 15.4 m
4
Diagonal = √(4.5² + 3.2²) = √(20.25 + 10.24) = √30.49 = 5.522 m
Area = 14.4 m²  |  Perimeter = 15.4 m  |  Diagonal = 5.5227 m
Try this example →

Example 2 - Farmland Plot

A rectangular agricultural plot measures 120 m by 85 m. How much area does it cover, and how much fencing is needed?

1
l = 120 m, w = 85 m
2
Area = 120 × 85 = 10,200 m² = 1.02 hectares
3
Perimeter (fencing needed) = 2 × (120 + 85) = 2 × 205 = 410 m
4
Diagonal = √(120² + 85²) = √(14400 + 7225) = √21625 = 147.06 m
Area = 10,200 m²  |  Perimeter = 410 m  |  Diagonal = 147.0612 m
Try this example →

Frequently Asked Questions

What is the formula for the area of a rectangle?+
Area = Length × Width. If a room is 6 m long and 4 m wide, its area is 6 × 4 = 24 m². Area is measured in square units (m², cm², ft², etc.).
How do I calculate the perimeter of a rectangle?+
Perimeter = 2 × (Length + Width). This gives the total distance around the outside of the rectangle. For a 6 m × 4 m rectangle, perimeter = 2 × (6 + 4) = 20 m.
How do I find the diagonal of a rectangle?+
The diagonal = √(Length² + Width²), derived from the Pythagorean theorem. For a 6 m × 4 m rectangle, diagonal = √(36 + 16) = √52 = 7.211 m. The two diagonals of any rectangle are always equal in length.
What is the difference between a rectangle and a parallelogram?+
A rectangle is a parallelogram with all four interior angles equal to 90°. All rectangles are parallelograms, but not all parallelograms are rectangles. A parallelogram can have non-right angles, while a rectangle always has right angles at every corner.
How do I find the length if I know the area and width?+
Rearrange the area formula: Length = Area / Width. For example, if the area is 48 m² and the width is 6 m, then Length = 48 / 6 = 8 m. Similarly, Width = Area / Length.
How do you find the area of a rectangle?+
Area of a rectangle = length x width. Example: a rectangle with length 12 cm and width 8 cm has area = 12 x 8 = 96 cm^2. Area is always in square units. If you only know the perimeter and one side, find the missing side first: missing side = (perimeter / 2) - known side. Then calculate area normally.
How do you calculate the diagonal of a rectangle?+
The diagonal of a rectangle is found using the Pythagorean theorem, since the diagonal divides the rectangle into two right triangles. Diagonal = sqrt(length^2 + width^2). Example: a rectangle 6 m by 8 m has diagonal = sqrt(6^2 + 8^2) = sqrt(36 + 64) = sqrt(100) = 10 m. The diagonal is always longer than either side but shorter than the sum of length and width.
What is the difference between a rectangle and a square?+
A square is a special rectangle where all four sides are equal. Every square is a rectangle, but not every rectangle is a square. A rectangle requires only that opposite sides are equal and all angles are 90 degrees. A square additionally requires all four sides to be equal. Formulas for rectangles work for squares by setting length = width = s: area = s^2, perimeter = 4s, diagonal = s x sqrt(2).