Rectangle Formula

Area, perimeter, and diagonal of any rectangle (or square)

Reviewed by Geometry Calculator, Geometry Calculator Developer & Online Math Educator Last updated May 12, 2026

A rectangle is a four-sided polygon with all four angles equal to 90°. Length l and width w are the two different side lengths. A square is a rectangle with l = w. Just three formulas cover all rectangle calculations.

Try it with your own numbers

Rectangle Calculator

The Formulas

Name Formula Notes
Area A = l × w l = length, w = width. Same units as the sides, squared.
Perimeter P = 2 × (l + w) = 2l + 2w Sum of all four sides; opposite sides are equal so it's twice the sum of length + width.
Diagonal d = √(l² + w²) Pythagorean theorem applied to the right-angled corner.
Width from Area + Length w = A / l Inverse — given the area and one side, recover the other.
Length from Perimeter + Width l = P/2 − w Inverse — solve for length when you know perimeter and width.
Square Special Case A = s², P = 4s, d = s·√2 When l = w = s, all formulas collapse to single-variable forms.

Worked Examples

Example 1: Rectangle 8 cm × 5 cm

  1. Area A = 8 × 5 = 40 cm²
  2. Perimeter P = 2(8 + 5) = 26 cm
  3. Diagonal d = √(8² + 5²) = √89 ≈ 9.43 cm

Example 2: Find length given area = 60, width = 5

  1. l = A / w = 60 / 5 = 12
  2. P = 2(12 + 5) = 34; d = √(144 + 25) = √169 = 13

Example 3: Square with side 6

  1. A = 6² = 36
  2. P = 4 × 6 = 24
  3. d = 6√2 ≈ 8.485

Real-World Applications of Rectangle Formulas

The geometric properties of a rectangle extend far beyond classroom exercises, serving as foundational tools in construction, interior design, and engineering. Because a rectangle is defined as a quadrilateral with four right angles, its predictable structure makes it ideal for measuring spaces where precision is critical. In construction and flooring projects, calculating the area using Area = length × width allows contractors to estimate material quantities accurately. Whether purchasing carpet, tile, or hardwood, knowing the exact surface area prevents waste and ensures sufficient stock is ordered. This calculation relies on the fundamental definition that area represents the amount of two-dimensional space enclosed within the shape.

Perimeter calculations are equally vital when dealing with boundaries and enclosures. For instance, framing a room or installing fencing around a rectangular yard requires determining the total distance around the shape. The formula Perimeter = 2(length + width) provides this measurement directly. Builders often use these figures to budget for materials like baseboards, trim, or fence panels. Understanding the relationship between side lengths helps in optimizing resource usage, ensuring that linear measurements align correctly with the physical layout of the project.

In carpentry and cabinetry, the diagonal measurement serves as a crucial check for squareness. Since opposite sides of a rectangle are equal and parallel, the diagonals must also be equal in length. If the measured diagonals differ, the structure is skewed, meaning the corners are not perfect right angles. Carpenters frequently apply the Pythagorean theorem to verify this alignment, treating the length and width as legs of a right triangle to calculate the expected diagonal. This method ensures that frames, doors, and windows fit properly without gaps or misalignments, maintaining structural integrity and aesthetic quality.

Common Mistakes When Using Rectangle Formulas

Even with straightforward formulas, errors can lead to significant discrepancies in real-world applications. One frequent mistake involves confusing the placement of length and width. While multiplication is commutative—meaning length × width yields the same result as width × length—this confusion can cause issues when dimensions are assigned to specific axes in coordinate geometry or when calculating perimeter in contexts where orientation matters. It is essential to clearly identify which dimension corresponds to which side to avoid errors in more complex geometric problems involving multiple shapes.

Another common pitfall is neglecting unit consistency. Measurements provided in different units, such as meters for length and centimeters for width, must be converted before calculation. Failing to perform proper unit conversion results in wildly incorrect area or perimeter values. For example, multiplying meters by centimeters directly produces a nonsensical hybrid unit that holds no practical meaning. Always ensure all dimensions are expressed in the same unit before applying any formula to maintain accuracy.

Misapplication of the Pythagorean theorem is also prevalent when dealing with diagonals. Some users incorrectly assume that the diagonal is simply the sum of the length and width. However, the diagonal forms the hypotenuse of a right triangle created by the two adjacent sides. The correct approach requires squaring both the length and width, summing those squares, and then taking the square root of the result. Additionally, users may forget that while a square (geometry) is a specific type of rectangle with equal sides, general rectangle formulas still apply. Recognizing these distinctions helps prevent calculation errors in both simple and advanced scenarios.

Rectangle Formula vs. Square Formula – Key Differences

Understanding the distinction between a rectangle and a square is crucial for selecting the correct mathematical approach. A square is a special case of a rectangle where all four sides are equal in length. Consequently, every square is a rectangle, but not every rectangle is a square. This hierarchical relationship means that the standard rectangle formulas for area and perimeter remain valid for squares, but they can be simplified due to the equality of sides.

When sides are equal, the rectangle's area formula A = l × w simplifies to A = s², where s represents the side length. Similarly, the perimeter formula P = 2(l + w) reduces to P = 4s. These simplified forms are more efficient for calculations involving squares, reducing the potential for error by minimizing the number of operations required. Recognizing when a shape is a square allows for quicker computations and clearer conceptual understanding.

Practical recognition tips involve examining the side lengths and angles. If a quadrilateral has four right angles and opposite sides are equal, it is a rectangle. If all four sides are equal, it is a square. In construction, checking for equal adjacent sides can quickly identify whether a square-specific formula should be used. Additionally, the diagonal of a square creates two congruent isosceles right triangles, whereas the diagonal of a non-square rectangle creates two congruent scalene right triangles. This geometric difference affects how the Pythagorean theorem is applied, reinforcing the need to distinguish between the two shapes accurately.

Skip the manual calculation

Plug in your numbers and get instant step-by-step results.

Use Rectangle Calculator See All Geometry Formulas