Home/Geometry/Rectangle Calculator

Rectangle Calculator

Calculate the area, perimeter, diagonal and dimensions of any rectangle with formulas, worked examples and real-world applications.

📖 Reading time: 11–13 minutes  ·  Last updated: 1 August 2026  ·  Reviewed by Mohsin Iqbal

Quick Answer: How Do You Calculate a Rectangle?

A rectangle can usually be solved from any two compatible known values — length, width, area, perimeter or diagonal. Area is A = l × w, perimeter is P = 2(l + w), and the diagonal is d = √(l² + w²) — the Pythagorean theorem, since a rectangle's diagonal splits it into two right triangles. Enter any two valid, compatible values below and the calculator finds the rest, with every step shown; not every arbitrary pair (for instance, some area-and-perimeter combinations) can describe a real rectangle, and the calculator will say so if that happens.

Formula Summary
Area: A = l × w  |  Perimeter: P = 2(l + w)
Diagonal: d = √(l² + w²)  (Pythagorean theorem)
Missing side: w = A / l = P/2 − l = √(d² − l²)
Aspect ratio: l : w  |  Diagonal angle: θ = arctan(w / l)
Enter Any Two Values

Leave the values you want solved for blank. Enter any two compatible values from length, width, area, perimeter or diagonal — the rest are calculated. Not every combination describes a valid rectangle; the calculator will explain if yours doesn't.

Keyboard: Enter calculates, Esc clears.


Quick Examples

Perimeter in Other Units
UnitPerimeter

Need surface area or volume instead? Try the area calculator or volume calculator.

Results
Length × Width
PropertyValue
Step-by-Step Working

Common uses: tap one to load a typical example.

Calculator Features

Instant calculation
🧮Step-by-step working
📐Find any missing value
🔄Unit conversion
🖨Printable results
📋Copy to clipboard
📱Mobile friendly
🆓Free to use

🧭 Jump to a section

What Is a Rectangle?

A rectangle is a four-sided shape (a quadrilateral) with four right angles, where opposite sides are equal in length. It's one of the most common shapes in daily life — rooms, doors, screens, books, bricks and sheets of paper are all rectangles, which is exactly why it's one of the most searched calculators in geometry.

Rectangle Properties

Area Formula

A = l × w. Multiply the length by the width. An 8 × 5 rectangle has an area of 40 square units. This is the most fundamental area formula in geometry — nearly every other 2D area formula, including a triangle's ½bh, is derived by comparing it back to a rectangle.

Perimeter Formula

P = 2(l + w). Add the length and width, then double it — equivalent to adding all four sides, since opposite sides match. The same 8 × 5 rectangle has a perimeter of 2(8 + 5) = 26 units. See the dedicated perimeter calculator for other shapes.

Diagonal Formula

d = √(l² + w²). A rectangle's diagonal splits it into two congruent right triangles, with the length and width as the two legs and the diagonal as the hypotenuse — so this is simply the Pythagorean theorem applied to a rectangle. For 8 × 5, d = √(64 + 25) = √89 ≈ 9.434 units. The diagonal is always the single longest straight-line measurement across a rectangle.

Finding a Missing Length or Width

You knowMissing sideFormula
Length and areaWidthw = A / l
Length and perimeterWidthw = P/2 − l
Length and diagonalWidthw = √(d² − l²)
Area and perimeterBoth sidesRoots of t² − (P/2)t + A = 0
Area and diagonalBoth sidesSum from √(d² + 2A), then the same quadratic
Perimeter and diagonalBoth sidesProduct from (s² − d²)/2, then the same quadratic

The calculator above accepts any two of the five values — length, width, area, perimeter or diagonal — and solves the rest using whichever formula applies, including the two trickier cases (area+perimeter and area+diagonal) that require solving a quadratic equation rather than simple substitution.

Aspect Ratio

The aspect ratio compares length to width, written l : w. A 16:9 rectangle is the standard widescreen shape for TVs and monitors; 4:3 was the older standard. Simplifying a ratio means dividing both numbers by their greatest common factor — 12:8 simplifies to 3:2, the same shape at a smaller scale. Two rectangles with the same aspect ratio are geometrically similar, even if their actual sizes differ.

Rectangle vs Square

PropertyRectangleSquare
SidesOpposite sides equal (l ≠ w generally)All four sides equal
AnglesFour right anglesFour right angles
AreaA = l × wA = s²
Diagonald = √(l² + w²)d = s√2
RelationshipEvery square is a rectangle (a special case with l = w); not every rectangle is a square

Rectangle vs Parallelogram

Both have two pairs of equal, parallel sides — but a parallelogram's angles don't have to be 90°. A rectangle is a parallelogram with the extra constraint of right angles, which is also why a rectangle's diagonals are always equal in length while a general parallelogram's usually aren't.

Step-by-Step Worked Examples

Length & width — 8 × 5

A = 8 × 5 = 40
P = 2(8 + 5) = 26
d = √(64 + 25) = √89 ≈ 9.434

Length & area — l = 8, A = 40

w = A / l = 40 / 8 = 5

Length & perimeter — l = 8, P = 26

w = P/2 − l = 13 − 8 = 5

Area & perimeter — A = 40, P = 26

s = P/2 = 13
l, w are roots of t² − 13t + 40 = 0 → t = (13 ± √(169−160))/2 = (13 ± 3)/2
l = 8, w = 5

Room flooring — 4.2 m × 3.6 m bedroom

A = 4.2 × 3.6 = 15.12 m²
Add 10% for cuts and waste → order about 16.6 m² of flooring

Wall painting — 6 m × 4 m feature wall

A = 6 × 4 = 24 m²
At 10 m² per litre, two coats need 24 × 2 ÷ 10 = 4.8 L

Real-World Applications

FieldUse
ConstructionSlab and footing dimensions, wall framing, formwork
FlooringTimber, tile and carpet area from room dimensions
PaintingWall area for paint coverage calculations
LandscapingLawn, garden bed and paved area sizing
ArchitectureRoom layouts, window and door proportions
ManufacturingSheet material sizing (plywood, glass, metal)

Common Mistakes

MistakeFix
Confusing area and perimeter unitsArea is squared (m²); perimeter is linear (m)
Using the diagonal as a side lengthThe diagonal is always longer than either side
Assuming a rectangle is a squareOnly true when length equals width
Mixing units between length and widthConvert everything to one unit first
Forgetting the ×2 in the perimeter formulaP = 2(l+w), not just l+w

Formula Cheat Sheet

Quick Reference

Area: A = l × w  |  Perimeter: P = 2(l + w)
Diagonal: d = √(l² + w²)
Missing width: w = A/l = P/2 − l = √(d² − l²)
Aspect ratio: l : w  |  Diagonal angle: θ = arctan(w/l)
From area & perimeter: t² − (P/2)t + A = 0

Practice Questions

Beginner (with answers)

  1. Find the area of a rectangle 9 m × 4 m.
  2. Find the perimeter of a rectangle 7 cm × 3 cm.
  3. A rectangle has length 10 and width 6. Find its diagonal (2 dp).
  4. A rectangle has l = 12, A = 60. Find w.
  5. Is every square a rectangle?
Show answers

1) 9×4=36 m²   2) 2(7+3)=20 cm   3) √(100+36)=√136≈11.66   4) w=60/12=5   5) Yes — a square is a rectangle with equal sides

Advanced (with answers)

  1. A rectangle has A = 84, P = 38. Find its dimensions.
  2. A rectangle has l = 9, d = 15. Find w and its area.
  3. A room 5 m × 4 m needs new carpet. How many m² should be ordered with 8% waste?
  4. Find the aspect ratio (simplified) of a 24 × 16 rectangle.
  5. A rectangle's diagonal is 13 and its width is 5. Find the length and perimeter.
Show answers

1) s=19, roots of t²−19t+84=0 → t=(19±√(361−336))/2=(19±5)/2 → 12 and 7   2) w=√(225−81)=√144=12, A=9×12=108   3) 20 m² × 1.08 = 21.6 m²   4) 24:16 = 3:2   5) l=√(169−25)=12, P=2(12+5)=34

🔑 Key Takeaways

Frequently Asked Questions

What is a rectangle?

A rectangle is a four-sided shape with four right angles, where opposite sides are equal and parallel. It's one of the most common shapes in everyday life — rooms, screens, doors and books are all rectangles.

How do you calculate the area of a rectangle?

A = l × w — multiply the length by the width. An 8 × 5 rectangle has an area of 40 square units.

How do you calculate the perimeter of a rectangle?

P = 2(l + w) — add the length and width, then double the result. An 8 × 5 rectangle has a perimeter of 2(8+5) = 26 units.

How do you find the diagonal of a rectangle?

d = √(l² + w²), the Pythagorean theorem applied to the two sides. An 8 × 5 rectangle has a diagonal of √(64+25) = √89 ≈ 9.434 units.

What is the rectangle formula?

There are three core formulas: area A = l×w, perimeter P = 2(l+w), and diagonal d = √(l²+w²). Any two of length, width, area, perimeter or diagonal are enough to find the rest.

How do you find the length and width?

From area and one side: divide (w = A/l). From perimeter and one side: w = P/2 − l. From the diagonal and one side: w = √(d² − l²). If only area and perimeter (or area and diagonal) are known, both sides come from solving a quadratic equation — this calculator does that automatically.

What is the difference between a rectangle and a square?

A square is a rectangle with all four sides equal. Every square is a rectangle, but a rectangle is only a square when its length equals its width.

Can a rectangle have equal sides?

Yes — when all four sides are equal, it's specifically called a square, which is a special case of a rectangle.

How is a rectangle used in construction?

Slabs, footings, wall frames and formwork are almost always rectangular, so area gives concrete or material volume and perimeter gives edge trim or formwork length.

How do builders measure rectangles?

By measuring length and width directly, then checking the diagonals are equal to confirm the corners are square — unequal diagonals mean the rectangle is actually a non-right parallelogram.

What units are used for rectangles?

Any linear unit for length, width, perimeter and diagonal (mm, cm, m, ft); area uses the squared version of the same unit (m², ft²).

Can I calculate rectangle dimensions online?

Yes — enter any two of length, width, area, perimeter or diagonal above and the calculator solves the rest instantly, with the working shown.

How accurate is a rectangle calculator?

The calculator uses standard double-precision arithmetic, but displayed results are rounded and cannot be more accurate than the measurements entered.

How do you measure a room?

Measure the length and width along the floor at their widest points, then use A = l×w for flooring area or P = 2(l+w) for skirting length.

How do you calculate flooring?

Multiply the room's length by its width to get the area, then add 8–10% for cuts, waste and pattern matching before ordering.

How do you calculate fencing for a rectangle?

Use the perimeter formula P = 2(l+w), then subtract the width of any gates.

Can students use this calculator?

Yes — enter any two known values and the calculator shows the formula and full working, which makes it useful for checking homework as well as producing an answer.

What is rectangle geometry?

The branch of Euclidean geometry dealing with four-sided shapes that have four right angles and equal opposite sides — covering area, perimeter, diagonals and the relationships between them.

What are common rectangle mistakes?

Confusing area (squared units) with perimeter (linear units); using the diagonal as if it were a side; assuming a rectangle is automatically a square; and mixing units between the length and width.

Why is rectangle calculation important?

Because rectangles are the most common shape in construction, flooring, painting and manufacturing — getting the area and perimeter right directly affects material orders and cost.

What is the aspect ratio of a rectangle?

The simplified ratio of length to width, written l:w. A 24×16 rectangle has an aspect ratio of 3:2. Rectangles with the same aspect ratio are geometrically similar regardless of actual size.

Is a rectangle a parallelogram?

Yes — a rectangle is a parallelogram with the extra condition that all angles are 90°. That's also why a rectangle's diagonals are always equal, unlike a general parallelogram's.

Can this calculator find dimensions from area and perimeter alone?

Yes — enter area and perimeter with length and width left blank, and the calculator solves the resulting quadratic equation to find both sides.

How do you calculate paint for a rectangular wall?

Find the wall's area (A = l×w), then divide by the paint's coverage rate per litre, multiplied by the number of coats — a 6×4 m wall at 10 m²/L needs about 4.8 L for two coats.

What's the difference between metric and imperial for rectangles?

The formulas are identical — only the units change. Metric uses mm, cm and m (with m² for area); imperial uses inches, feet and yards (with ft² for area). This calculator supports both.

Printable Formula Sheet

A one-page reference with every rectangle formula on this page.

Rectangle Formula Sheet

MegaCalcOnline.com  ·  Area, perimeter, diagonal and missing-side formulas

FindFormula
AreaA = l × w
PerimeterP = 2(l + w)
Diagonald = √(l² + w²)
Width from length & areaw = A / l
Width from length & perimeterw = P/2 − l
Width from length & diagonalw = √(d² − l²)
Both sides from area & perimeterRoots of t² − (P/2)t + A = 0
Aspect ratiol : w (simplified)
Diagonal angleθ = arctan(w / l)

About This Calculator

✅ Reviewed by Mohsin Iqbal

This calculator has been reviewed for mathematical accuracy against standard Euclidean geometry. It solves from any two of length, width, area, perimeter or diagonal — including the two cases that require solving a quadratic equation (area+perimeter and area+diagonal) rather than simple substitution — and cross-checks any additional values entered against the calculated rectangle.

Last updated: 1 August 2026  ·  Last reviewed: 1 August 2026  ·  Educational information only.

References

Every formula and worked example on this page was independently verified — see “About This Calculator” above for the full review notes.