terican

Last verified · v1.0

Calculator · math

Rectangle Calculator (Area, Perimeter, Diagonal)

Compute the area, perimeter, and diagonal of any rectangle by entering its length and width. Supports all consistent linear units.

FreeInstantNo signupOpen source

Inputs

Calculated Result

Explain my result

0/3 free

Get a plain-English breakdown of your result with practical next steps.

Calculated Resultunits

The formula

How the
result is
computed.

Rectangle Calculator: Area, Perimeter, and Diagonal

A rectangle is a four-sided polygon where every interior angle measures exactly 90 degrees and opposite sides are equal in length. Three fundamental measurements define a rectangle beyond its basic dimensions: its area, perimeter, and diagonal. This calculator computes all three from just two inputs — length (ℓ) and width (w).

Understanding the Variables

  • Length (ℓ): The longer dimension of the rectangle, measured in any consistent linear unit (meters, feet, inches, centimeters, etc.).
  • Width (w): The shorter dimension, perpendicular to the length, expressed in the same unit.

Area Formula: A = ℓ × w

The area of a rectangle equals the product of its length and width. Geometrically, this formula counts how many unit squares tile the rectangle's interior surface. According to De Montfort University's Area of a Rectangle reference, A = ℓ × w is foundational to all planar measurement and underpins practical calculations in construction, agriculture, and interior design.

Example: A room measuring 7 meters long and 4 meters wide has an area of 7 × 4 = 28 square meters.

Perimeter Formula: P = 2(ℓ + w)

The perimeter measures the total distance around the rectangle's boundary. Because opposite sides are equal, the total boundary equals two lengths plus two widths, simplified to P = 2(ℓ + w). As documented in the ORCCA Geometry Formulas curriculum at Lane Community College, this formula applies directly to fencing projects, picture framing, and any task requiring the total edge length.

Example: For the same 7 m × 4 m room, the perimeter is 2(7 + 4) = 2 × 11 = 22 meters — the exact length of baseboard trim needed to line all four walls.

Diagonal Formula: d = √(ℓ² + w²)

The diagonal of a rectangle connects two opposite corners. Because the diagonal, length, and width form a right triangle, the Pythagorean theorem applies directly: d = √(ℓ² + w²). This relationship holds for every rectangle regardless of its proportions.

Deriving the Diagonal

Drawing one diagonal across a rectangle produces two congruent right triangles. Each triangle has legs of length ℓ and w, with the diagonal as the hypotenuse. The Pythagorean theorem states ℓ² + w² = d², which rearranges to d = √(ℓ² + w²). No assumptions beyond the definition of a rectangle — four right angles — are required for this derivation.

Example: A rectangle 6 feet long and 8 feet wide has a diagonal of √(36 + 64) = √100 = 10 feet. Carpenters routinely use this result to verify square corners: if the measured diagonal matches the formula's output, all four corners sit at exactly 90 degrees.

Real-World Applications

  • Construction and architecture: Floor area drives material estimates; perimeter determines framing lumber; diagonal confirms that layouts are square.
  • Landscaping and agriculture: Rectangular plot area guides fertilizer quantities, while perimeter determines how much fencing a property requires.
  • Interior design: Room area informs rug sizing, tile counts, and paint coverage calculations per manufacturer specifications.
  • Screen and display technology: Monitor and television diagonal measurements follow the identical formula, with screen height and width as the two legs.
  • Shipping and logistics: Pallet and container footprint area assists load planning, while diagonal helps confirm whether items fit within angular constraints.

How to Use This Calculator

Select the property to compute — area, perimeter, or diagonal — then enter the rectangle's length and width in any consistent linear unit. The calculator applies the relevant formula and returns the result instantly. Switching between calculation types requires no re-entry of dimensions, making it straightforward to obtain all three values for a single rectangle.

Sources and Methodology

The formulas implemented here follow standard Euclidean geometry as presented in De Montfort University's Area of a Rectangle and the ORCCA Geometry Formulas curriculum at Portland Community College. Both sources confirm A = ℓw, P = 2(ℓ + w), and the Pythagorean diagonal d = √(ℓ² + w²) as the authoritative formulas for all rectangular geometry calculations.

Reference

Frequently asked questions

What is the formula for the area of a rectangle?
The area of a rectangle equals length multiplied by width: A = ℓ × w. For example, a rectangle 12 feet long and 5 feet wide has an area of 12 × 5 = 60 square feet. Area is always expressed in square units — square meters, square feet, or square inches — because it represents a two-dimensional surface rather than a linear distance.
How do you calculate the perimeter of a rectangle?
The perimeter of a rectangle is P = 2(ℓ + w), which equals twice the sum of length and width. A rectangle 9 meters long and 3 meters wide has a perimeter of 2(9 + 3) = 24 meters. This value represents the total boundary length and is essential for practical tasks like installing fencing, baseboards, window trim, or picture frames.
What formula is used to find the diagonal of a rectangle?
The diagonal is calculated using the Pythagorean theorem: d = √(ℓ² + w²). For a rectangle 3 feet long and 4 feet wide, the diagonal is √(9 + 16) = √25 = 5 feet. The diagonal represents the straight-line distance between two opposite corners and equals the hypotenuse of the right triangle formed by the rectangle's length and width.
What units should be entered into a rectangle calculator?
Any consistent linear unit works — meters, feet, centimeters, inches, or yards. The critical requirement is that length and width must share the same unit before calculating. Area results will appear in the corresponding square unit (e.g., square meters), while perimeter and diagonal results will appear in the same linear unit that was entered for the dimensions.
Can this rectangle calculator also handle squares?
Yes. A square is a special case of a rectangle where length equals width (ℓ = w). Entering the same value for both length and width correctly computes area as ℓ², perimeter as 4ℓ, and diagonal as ℓ√2. All three rectangle formulas apply without any modification, since a square satisfies every defining property of a rectangle — four right angles and equal opposite sides.
Why does the rectangle diagonal formula use the Pythagorean theorem?
Drawing a diagonal across a rectangle divides it into two congruent right triangles. The diagonal becomes the hypotenuse of each triangle, while the rectangle's length and width become the two legs. The Pythagorean theorem states that for any right triangle ℓ² + w² = d². Solving for d yields √(ℓ² + w²), making the theorem the direct and only mathematical basis needed for the rectangle diagonal formula.