Smekys
Ad Space

Diagonal of a Rectangle Calculator

Free rectangle diagonal calculator: enter length and width to instantly get the diagonal (Pythagorean theorem), area, perimeter and corner angle.

Enter Values

in

The long side of the rectangle (the base of the right triangle).

in

The short side of the rectangle (the perpendicular leg).

digits

How many decimal places to show on diagonal, area and perimeter (0 = whole number).

Result

Diagonal (d)
13
Area
60
Perimeter
34
Diagonal Angle at Corner
22.6°

A rectangle is defined by two perpendicular sides, but once you draw the line from one corner to the opposite corner you have split it into two identical right triangles. That line — the diagonal — is the hypotenuse of each triangle, and its length follows directly from the Pythagorean theorem. This calculator takes the length and width of any rectangle and instantly returns the diagonal, along with the area, the perimeter, and the angle the diagonal makes with the long side.

Whether you are hanging a picture, checking whether a flat screen will fit in a cabinet, ordering fencing, or laying tile, the diagonal is often the number you actually need even when the length and width are what you can measure. Enter the two sides below and every result updates as you type.

How to Use

  1. Enter the Length — the longer horizontal side of the rectangle, in inches, feet, centimeters, or any consistent unit. Keep the same unit for both sides.
  2. Enter the Width — the shorter, perpendicular side. It must be a non-negative number; a rectangle cannot have a negative side.
  3. Read the Diagonal (d) in the highlighted result card. This is the straight-line distance between opposite corners.
  4. Check the Area and Perimeter rows, which are computed automatically from the same two sides.
  5. Optionally note the Diagonal Angle at Corner, the angle between the long side and the diagonal, in degrees.

The engine treats the diagonal as the hypotenuse of a right triangle whose legs are the length and the width, so the result is always sqrt(length² + width²). Because both sides use the same unit, the diagonal comes back in that same unit — no conversion needed.

The Rectangle Diagonal Formula

The diagonal of a rectangle is derived directly from the Pythagorean theorem. The length and width are the two legs of a right triangle, and the diagonal connecting opposite corners is the hypotenuse:

d = √(length² + width²)

Where:

  • d is the diagonal — the distance between opposite corners.
  • length is the long side of the rectangle.
  • width is the short, perpendicular side.

Worked example on a rectangle that is 12 inches long and 5 inches wide: the diagonal is √(12² + 5²) = √(144 + 25) = √169 = 13 inches. Notice this is the classic 5-12-13 right triangle, a close cousin of the famous 3-4-5 triangle. The same rectangle has an area of 12 × 5 = 60 square inches and a perimeter of 2 × (12 + 5) = 34 inches.

Two companion formulas fall out of the same two inputs:

  • Area = length × width
  • Perimeter = 2 × (length + width)

The angle the diagonal makes with the long side is atan2(width, length) in degrees. On the 12 × 5 rectangle that angle is about 22.6°, which means the diagonal tilts roughly 22.6 degrees off the long edge. If the rectangle is a square (length = width), the diagonal splits the corner into two exact 45° angles.

Why the Diagonal Matters in Real Life

People measure the sides of a box, room, or screen all the time, but the diagonal is the dimension that decides fit:

  • Screens and displays are advertised by diagonal size, not by width and height. A 55-inch TV measures corner to corner, which is why two "55-inch" screens from different makers can have slightly different frames.
  • Moving and fitting furniture — a couch may be shorter than a doorway, but its corner-to-corner depth is what decides whether it will turn.
  • Framing and layout — carpenters use the 3-4-5 diagonal trick to check that a foundation or wall is square: if the diagonal measures exactly √(3² + 4²) = 5 units, the corners are true right angles.
  • Materials cost — carpet, flooring, and sod are priced by area, while fencing is priced by perimeter. On a 12-foot by 10-foot patio, the area is 120 square feet; if flooring costs $4 per square foot, the material alone runs about $480, and the 44-foot perimeter needs roughly $132 of fencing at $3 per foot.

Examples

Example 1 — The textbook 5-12-13 rectangle. A sheet of plywood is 12 units long and 5 units wide. The diagonal comes out to exactly 13 units, the area is 60 square units, and the perimeter is 34 units. Because the numbers form a Pythagorean triple, the diagonal is a whole number rather than a long decimal.

Example 2 — Fitting a TV. A wall space is 48 inches wide and 28 inches tall. The diagonal clearance is √(48² + 28²) = √(2304 + 784) = √3088 ≈ 55.6 inches. That means a 55-inch TV will physically fit, but a 65-inch model (about 74 inches corner to corner) will not. Always compare the advertised diagonal against your opening's diagonal.

Example 3 — Pricing a patio. A patio measures 20 feet by 15 feet. The area is 20 × 15 = 300 square feet; at $3.50 per square foot for concrete, that is about $1,050 in material. The perimeter is 2 × (20 + 15) = 70 feet, which sets how much edging or fencing to buy. The diagonal across the patio is √(400 + 225) = √625 = 25 feet — another clean 15-20-25 triple.

Example 4 — A large industrial sheet. A metal plate is 1,000,000 units long and 600,000 units wide. The area is 600 billion square units, the perimeter is 3,200,000 units, and the diagonal is √(10¹² + 3.6 × 10¹¹) ≈ 1,166,190 units. The calculator scales cleanly from centimeters up to factory dimensions without rounding error.

FAQ

How do you find the diagonal of a rectangle?

Square the length, square the width, add the two results together, and take the square root. In formula form: diagonal = √(length² + width²). This is the Pythagorean theorem applied to the right triangle formed by the length, the width, and the diagonal.

Is the diagonal of a rectangle equal to the sides?

No. The diagonal is always longer than either side but shorter than the sum of the two sides. On a 12 × 5 rectangle the sides are 12 and 5, but the diagonal is 13 — longer than the 12-inch side but well under the 17-inch sum. Only a square's diagonal relates to its sides by a fixed √2 multiplier: diagonal = side × √2.

What if I only know the diagonal and the area?

You can still recover the sides. Given diagonal d and area A, the length and width are the roots of the pair length² + width² = d² and length × width = A. In practice, entering the two sides is far simpler, so measure what you can and let the calculator do the algebra.

Does this work for a square?

Yes. A square is just a rectangle with equal sides. If length = width = s, the diagonal collapses to √(s² + s²) = s√2, and the corner angle is exactly 45°. Enter the same number for both length and width to confirm.

What happens when a side is zero?

If one side is 0, the shape collapses into a line segment equal to the other side. The diagonal equals the non-zero side, the area is 0, and the perimeter is twice the non-zero side. For example, 0 by 5 gives a diagonal of 5 and an area of 0.

Why is the diagonal used to measure TVs and phone screens?

Displays are sold by diagonal size because the corner-to-corner distance is a stable marketing number regardless of the screen's aspect ratio. A "55-inch" television is 55 inches from one corner to the opposite corner, which is exactly what this calculator computes once you know the width and height.

Disclaimer

This diagonal-of-a-rectangle calculator is provided for informational purposes only and does not constitute engineering, construction, or design advice. Results are based on the Pythagorean theorem and the exact inputs you enter; real-world fit, framing, and material orders should be double-checked against the actual object and measured on site. Always confirm critical dimensions directly before cutting materials or making a purchase. For our editorial standards see the About page, and for data handling see the Privacy Policy; we do not store the dimensions you enter on this page.

Related Calculators

Disclaimer

Results are estimates for illustration only. Verify important figures independently.