Calculate the area, perimeter, diagonal and dimensions of any rectangle with formulas, worked examples and real-world applications.
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.
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
| Unit | Perimeter |
|---|
Need surface area or volume instead? Try the area calculator or volume calculator.
| Property | Value |
|---|
Common uses: tap one to load a typical example.
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.
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.
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.
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.
| You know | Missing side | Formula |
|---|---|---|
| Length and area | Width | w = A / l |
| Length and perimeter | Width | w = P/2 − l |
| Length and diagonal | Width | w = √(d² − l²) |
| Area and perimeter | Both sides | Roots of t² − (P/2)t + A = 0 |
| Area and diagonal | Both sides | Sum from √(d² + 2A), then the same quadratic |
| Perimeter and diagonal | Both sides | Product 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.
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.
| Property | Rectangle | Square |
|---|---|---|
| Sides | Opposite sides equal (l ≠ w generally) | All four sides equal |
| Angles | Four right angles | Four right angles |
| Area | A = l × w | A = s² |
| Diagonal | d = √(l² + w²) | d = s√2 |
| Relationship | Every square is a rectangle (a special case with l = w); not every rectangle is a square | |
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.
| Field | Use |
|---|---|
| Construction | Slab and footing dimensions, wall framing, formwork |
| Flooring | Timber, tile and carpet area from room dimensions |
| Painting | Wall area for paint coverage calculations |
| Landscaping | Lawn, garden bed and paved area sizing |
| Architecture | Room layouts, window and door proportions |
| Manufacturing | Sheet material sizing (plywood, glass, metal) |
| Mistake | Fix |
|---|---|
| Confusing area and perimeter units | Area is squared (m²); perimeter is linear (m) |
| Using the diagonal as a side length | The diagonal is always longer than either side |
| Assuming a rectangle is a square | Only true when length equals width |
| Mixing units between length and width | Convert everything to one unit first |
| Forgetting the ×2 in the perimeter formula | P = 2(l+w), not just l+w |
A = l × w | Perimeter: P = 2(l + w)d = √(l² + w²)w = A/l = P/2 − l = √(d² − l²)l : w | Diagonal angle: θ = arctan(w/l)t² − (P/2)t + A = 0
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
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
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.
A one-page reference with every rectangle formula on this page.
MegaCalcOnline.com · Area, perimeter, diagonal and missing-side formulas
| Find | Formula |
|---|---|
| Area | A = l × w |
| Perimeter | P = 2(l + w) |
| Diagonal | d = √(l² + w²) |
| Width from length & area | w = A / l |
| Width from length & perimeter | w = P/2 − l |
| Width from length & diagonal | w = √(d² − l²) |
| Both sides from area & perimeter | Roots of t² − (P/2)t + A = 0 |
| Aspect ratio | l : w (simplified) |
| Diagonal angle | θ = arctan(w / l) |