Skip to main content

Online Calculator Lab

Rectangle Calculator

Find area, perimeter, diagonal & angles instantly. Enter length & width — or solve from area, perimeter, or diagonal.

Length (l)12
Width (w)8
Rectangle Diagram

What Is a Rectangle Calculator?

A rectangle calculator finds every geometric property of a rectangle — area, perimeter, diagonal length, and interior angles — from any two known values. Unlike a circle where one measurement (radius) unlocks everything, a rectangle needs two independent measurements because its length and width can vary independently.

This calculator offers four input modes: Length × Width (the most common), Area + Length (to find missing width), Perimeter + Length (common in fencing problems), and Diagonal + Length (used in construction squaring). Enter any valid pair and all other properties compute instantly with a labeled diagram.

How to Use This Calculator

  1. Choose your input mode: Pick whichever two values you already know — Length & Width, Area & Length, Perimeter & Length, or Diagonal & Length
  2. Enter both values — the labels update to match your selected mode
  3. Select a unit (cm, m, inches, feet, etc.) — area output uses the squared version of your unit automatically
  4. Choose decimal places (2, 4, or 6) for output precision
  5. Click "Calculate Rectangle" to see area, perimeter, diagonal, and angles — plus an SVG diagram with your exact dimensions
📌 Quick check: Enter length = 12 and width = 8. You should get Area = 96, Perimeter = 40, Diagonal = 14.4222, α = 33.6901°, β = 56.3099°. These match the worked example in the formula section below exactly.

Rectangle Formulas Explained

Three formulas cover all rectangle calculations. Area uses multiplication, perimeter uses addition, and the diagonal uses the Pythagorean theorem — because the diagonal of a rectangle is the hypotenuse of the right triangle formed by its length and width:

Given length l and width w: Area A = l × w Perimeter P = 2 × (l + w) Diagonal d = √(l² + w²) ← Pythagorean theorem Angle α α = arctan(w ÷ l) ← angle at length side Angle β β = 90° − α ← angle at width side Reverse formulas: From A and l: w = A ÷ l From P and l: w = (P ÷ 2) − l From d and l: w = √(d² − l²) Worked example — l = 12, w = 8: Area = 12 × 8 = 96 Perimeter = 2 × (12 + 8) = 2 × 20 = 40 Diagonal = √(12² + 8²) = √(144+64) = √208 = 14.4222 Angle α = arctan(8 ÷ 12) = 33.6901° Angle β = 90° − 33.6901° = 56.3099°
📌 The diagonal trick for squaring corners: In construction, a rectangle is confirmed square (right-angled) by measuring both diagonals — if d₁ = d₂, all four corners are 90°. For a 12×8 ft room, both diagonals should measure exactly 14.4222 ft. If they differ, the room is out of square and needs adjustment before flooring or tiling.

Rectangle Reference Table

Every row is independently calculated — no interpolation. Diagonal values use the exact Pythagorean formula:

LengthWidthAreaPerimeterDiagonal
21262.2361
4312145.0000
5420186.4031
8540269.4340
106603211.6619
108803612.8062
128964014.4222
15101505018.0278
20122406423.3238
25153758029.1548

Notice the 4×3 rectangle produces a diagonal of exactly 5.0000 — that's the famous 3-4-5 Pythagorean triple (3² + 4² = 5²). Builders use this relationship to check corners: measure 3 ft along one wall, 4 ft along the adjacent wall, and the diagonal between those two points should be exactly 5 ft if the corner is a true right angle. Reference: Khan Academy — Pythagorean Theorem

Understanding the Rectangle Diagonal

The diagonal of a rectangle runs from one corner to the opposite corner. It's always longer than either side but shorter than their sum — bounded by max(l, w) < d < l + w. For a 12×8 rectangle: max(12,8) = 12 < 14.4222 < 20 (l+w). Every rectangle has two diagonals of equal length that bisect each other at their midpoints — a property that squares share but parallelograms don't.

ShapeLengthWidthDiagonalAngle αAngle β
3-4-5 rectangle435.000036.8699°53.1301°
Primary example12814.422233.6901°56.3099°
10×6 rectangle10611.661930.9638°59.0362°
5×4 rectangle546.403138.6598°51.3402°
Square (10×10)101014.142145.0000°45.0000°

The square row shows a useful fact: when length equals width, both diagonal angles are exactly 45°. The diagonal of a square always equals the side length multiplied by √2 ≈ 1.4142. A 10×10 square has diagonal 10 × 1.4142 = 14.1421 — and that same √2 factor appears in every square regardless of size.

Real-World Rectangle Examples

Rectangles are the most common shape in construction, design, and everyday objects. Three examples with all values calculated from the formulas above:

  • Room dimensions (15 × 12 ft): Area = 180 sq ft (flooring needed), Perimeter = 54 ft (baseboard trim needed), Diagonal = 19.2094 ft (squaring check measurement). For carpet that costs $3.50/sq ft, total material cost = 180 × $3.50 = $630 before waste factor.
  • NFL football field (360 × 160 ft): Area = 57,600 sq ft, Perimeter = 1,040 ft. The playing field alone (excluding end zones) is 300 × 160 ft = 48,000 sq ft. Diagonal = √(360² + 160²) = √(129,600 + 25,600) = √155,200 = 393.95 ft — the longest kick return path possible.
  • US Letter paper (11 × 8.5 in): Area = 93.5 sq in, Perimeter = 39 in, Diagonal = 13.9014 in. Standard A4 paper (the international equivalent) is 297 × 210 mm = 62,370 mm² = 623.70 cm².

Reference: NIST — SI Units of Length

Aspect Ratios and Common Rectangle Formats

Aspect ratio is the ratio of length to width (or width to height in screen terminology). Most screens, papers, and photographs use standardized ratios that were chosen for aesthetic or technical reasons. All diagonals below are calculated at unit scale — multiply by actual size for real dimensions:

FormatRatioArea (unit)Diagonal (unit)Common Use
HD Video / Widescreen16:9144.0018.3576TV, YouTube, monitors
Ultrawide Monitor21:9189.0022.8473Gaming, productivity
Classic TV / Photos4:312.005.0000Old monitors, photos
35mm Film / DSLR3:26.003.6056Camera sensors, prints
Square1:11.001.4142Instagram, prints
US Letter Paper8.5:1193.5013.9014US standard paper
A4 Paper (metric)√2:162,370 mm²360.56 mmInternational standard

A4 paper's ratio is particularly elegant: it's designed so that folding an A4 sheet in half along the long edge produces an A5 sheet with the exact same aspect ratio. This works because the ratio is √2:1 — halving the long side gives √2/2 : 1 = 1 : √2, which is the same ratio flipped. Reference: ISO 216 — Standard Paper Sizes

5 Tips for Rectangle Calculations

  • Use the 3-4-5 rule to check right angles without a protractor. A 4×3 rectangle has a diagonal of exactly 5.0000. In construction: measure 3 units along one wall from a corner, 4 units along the adjacent wall, and if the diagonal between those endpoints is 5 units, the corner is a perfect 90°. Any Pythagorean triple works (5-12-13, 8-15-17) — 3-4-5 is simply the most convenient.
  • When measuring for flooring or carpet, add 10% waste. A 15×12 ft room has 180 sq ft of floor area. Carpet installers recommend ordering 180 × 1.10 = 198 sq ft to account for cuts, seams, and direction matching. Tile calculations typically add 5–10% for breakage, with more needed for diagonal tile patterns.
  • Perimeter determines fencing or framing material — not area. A 25×15 garden plot has 375 sq ft of growing area but requires 80 linear feet of fencing (perimeter = 80). These two numbers are independent — a 20×20 plot has the same 400 sq ft area but different perimeter (80 ft) and different shape entirely. Budget fencing from perimeter, seed from area.
  • Doubling one side doubles area but not perimeter proportionally. A 12×8 rectangle (area 96, perimeter 40) vs 24×8 (area 192, perimeter 64): area doubled, but perimeter went from 40 to 64 — only a 60% increase. This asymmetry matters for cost estimation when you change one room dimension.
  • The diagonal of a square is always side × √2 ≈ side × 1.4142. A 10×10 room has a diagonal of 14.1421 ft. This √2 factor comes directly from Pythagoras: d = √(s²+s²) = s√2. Useful for quickly estimating whether a piece of furniture can fit through a doorway diagonally — a 36-inch-wide door can pass an item up to 36 × 1.4142 = 50.9 inches wide at 45°.

Frequently Asked Questions — Rectangle Calculator

Area = length × width. For a rectangle with length 12 and width 8: Area = 12 × 8 = 96. The unit of area is always the square of the length unit — square feet, square meters, square inches, etc. To find a missing side when you know the area: width = Area ÷ length. For Area = 96 and length = 12: width = 96 ÷ 12 = 8.
Diagonal = √(length² + width²) — the Pythagorean theorem applied to the right triangle formed by the two sides. For length 12 and width 8: diagonal = √(144 + 64) = √208 = 14.4222. The diagonal is always longer than either side. A quick mental check: if length is much larger than width, the diagonal is approximately equal to the length — a very wide, flat rectangle has a diagonal close to its length.
Yes — by definition. A rectangle is a quadrilateral with four right angles, and a square meets that definition while also having all four sides equal. Every square is a rectangle, but not every rectangle is a square. This matters for formulas: a square with side s has area = s², perimeter = 4s, and diagonal = s√2. Enter equal values for length and width in this calculator to confirm — a 10×10 square gives diagonal = 14.1421 = 10 × √2.
Rearrange the perimeter formula: width = (Perimeter ÷ 2) − length. For perimeter = 40 and length = 12: width = (40 ÷ 2) − 12 = 20 − 12 = 8. Use the "Perimeter + Length" mode in this calculator for the same result automatically. This comes up often in fencing problems where you know the total fence length and one property dimension but need the other.
All four interior angles of any rectangle are exactly 90° — that's part of the definition. But the diagonal creates two different acute angles inside the rectangle. For a 12×8 rectangle, the diagonal makes an angle of α = 33.6901° with the long side and β = 56.3099° with the short side, and α + β = 90° always. A square (equal sides) gives α = β = 45° exactly. These diagonal angles are useful in carpentry and tiling for cutting boards at the correct miter angle.
Area measures the surface inside the rectangle (in square units); perimeter measures the total boundary length (in linear units). A 15×12 room: area = 180 sq ft tells you how much flooring or carpet to buy; perimeter = 54 ft tells you how much baseboard trim or wallpaper border you need. They're completely independent — you can't infer one from the other without knowing both sides. Two rectangles with the same area (say, 12×8 = 96 and 16×6 = 96) have different perimeters (40 vs 44).