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 typeCommon 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
- 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)
- Enter length and width to see each step.
- —
- —
- 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
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
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.
What is the perimeter of a rectangle?
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.
How do I find a rectangle's diagonal?
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).
How can I find the missing side if I know the area and one side?
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.
Can I find a side from the perimeter?
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.
How do I recover both sides from the diagonal and the length?
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.
What is the difference between a rectangle and a square?
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.
What is a "golden rectangle"?
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.
Why do TV sizes use a diagonal measurement?
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.
Does the rectangle have to lie flat, or can these formulas apply in 3D?
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.