Skip to content

Rectangle Calculator

Enter two dimensions to get area, perimeter and diagonal live. Or flip it — give an area, perimeter or diagonal plus one side, and the calculator solves for the other.

Dimensions

Updates as you type
What do you want to solve for?
Solve for ?
Inputs
Length (l) ?
0255075100
Width (w)
0255075100
Aspect ratio ? free
Display (result units)
Show results in

Common rectangles, compared to yours

vs. your rectangle
Item Length Width Area Diagonal vs yours
Enter dimensions to compare against common rectangles.

The "vs yours" column shows how many of your current rectangle fit inside the reference shape (or vice-versa). Handy for sanity-checking whether a room, screen, or piece of material is the right size.

Formula

A = l × w   P = 2(l + w)   d = √(l² + w²)
A
Area — the space enclosed by the rectangle
P
Perimeter — distance around the outside
d
Diagonal — corner-to-corner straight line
l
Length — the longer side
w
Width — the shorter side (perpendicular to length)
Worked example — your numbers
  1. Enter length and width to see each step.
  2. Result:

All three rectangle formulas use only two inputs: length and width. Pythagoras' theorem supplies the diagonal, because the diagonal splits the rectangle into two right triangles with legs l and w.

Examples

How It Works

A rectangle is a four-sided shape with four right angles and two pairs of equal sides. The longer pair is traditionally called the length (l) and the shorter pair the width (w), though the names don't matter to the math — multiply them to get the area, add them and double to get the perimeter.

The three core formulas are A = l × w, P = 2(l + w), and d = √(l² + w²). The diagonal formula is just Pythagoras' theorem: the diagonal splits the rectangle into two right triangles whose legs are the length and width. That same relationship lets you work backward — if you know the diagonal and one side, you can recover the other side as w = √(d² − l²). Similarly, given an area or perimeter and one side, a little algebra supplies the other.

This calculator handles all four scenarios: enter two sides and it returns everything; or pick one of the inverse modes, supply the known value plus the length, and it solves for the remaining side. Each input accepts a different unit, so you can mix, for example, a length in feet with a width in centimetres and still get a clean answer.

Tips & Best Practices

Doubling both sides quadruples the area, but only doubles the perimeter — area scales with the square of linear size.
The diagonal is always longer than either side but shorter than length + width.
For a square, length equals width, so the diagonal simplifies to d = l × √2 ≈ 1.414 × l.
Aspect ratio tells you shape, not size — a 16:9 rectangle can be 16 cm × 9 cm or 160 m × 90 m.
When measuring real objects, always measure the diagonal too — it catches rooms and frames that are out-of-square.
Screen diagonals are the marketing number (e.g., "55-inch TV"). Use the 16:9 or 21:9 preset to recover the actual width and height.

Frequently Asked Questions

How do I calculate a rectangle's area?

Multiply length by width: A = l × w. The result is in square units — if both sides are in metres, the area is in square metres (m²). Mixing units (e.g., feet × inches) is valid math, but the result is awkward, so convert both sides to the same unit first.

Perimeter is the total distance around the outside: P = 2(l + w). You can also think of it as the length of fence, trim, or border you would need to enclose the shape. Unlike area, perimeter is always expressed in linear units.

Use Pythagoras' theorem: d = √(l² + w²). The diagonal connects two opposite corners and splits the rectangle into two congruent right triangles whose hypotenuse is the diagonal. For a 3 × 4 rectangle, the diagonal is exactly 5 (a classic 3-4-5 triangle).

Divide: w = A / l. For example, if the area is 24 m² and the length is 6 m, the width is 24 / 6 = 4 m. Select the "Area + length" mode in this calculator to do it automatically.

Yes. Rearrange P = 2(l + w) to get w = P/2 − l. Given P = 20 and l = 6, the width is 20/2 − 6 = 4. The "Perimeter + length" mode handles the algebra for you.

Square both, subtract, then take the root: w = √(d² − l²). This is Pythagoras rearranged. If you know the diagonal plus an aspect ratio (e.g., 16:9 for a TV) you can solve for both sides — set aspect to the ratio you want and the diagonal in the calculator.

Every square is a rectangle (four right angles, opposite sides equal), but most rectangles are not squares. A square is the special case where all four sides are equal, so length = width. For a square, area = s², perimeter = 4s, and diagonal = s√2.

A golden rectangle has a length-to-width ratio of φ (phi) ≈ 1.618. It has the property that if you remove a square section, the remaining rectangle is also golden. Golden rectangles appear in art, architecture, and design — the Parthenon, book covers, credit cards are all approximately golden.

The diagonal is a single number that captures both the width and the height for a given aspect ratio, making it easy to compare screen sizes across brands. Combined with the aspect ratio (16:9 is standard for TVs, 21:9 for ultrawide monitors), you can recover the exact width and height. A 55-inch 16:9 TV is roughly 48.0 × 27.0 inches.

The formulas apply to any flat (planar) rectangle, regardless of how it is oriented in space. For 3D shapes built from rectangles — a box (cuboid), a rectangular prism, a shipping crate — you apply these formulas to each face separately, then sum or combine as needed.