Diagonal Calculator

Find the diagonal of a rectangle or square from its length and width, or the space diagonal of a box from its length, width and height.

Diagonal formulas

Rectangle: d = √(length² + width²) Square: d = side × √2 Box: d = √(length² + width² + height²)

The diagonal splits a rectangle into two right triangles, so it is the hypotenuse given by the Pythagorean theorem.

Worked example

A 12 × 5 rectangle has a diagonal of √(144 + 25) = √169 = 13. A box 12 × 5 × 4 has a space diagonal of √(144 + 25 + 16) = √185 ≈ 13.60.

Common uses

  • Checking that a frame, deck or foundation is square: both diagonals should match.
  • Finding the longest item that fits in a box or room.
  • Screen sizes, which are measured along the diagonal.

Frequently asked questions

How do I find the diagonal of a square?

Multiply the side length by √2, about 1.4142. A 10-inch square has a diagonal of about 14.14 inches.

How do I check if a rectangle is square?

Measure both diagonals. If they are equal, the corners are 90°.

What is the 3-4-5 rule?

A triangle with sides 3, 4 and 5 always has a right angle, so builders use it to lay out square corners.

Does the unit matter?

No. The diagonal comes out in the same unit as the sides you enter.

Related calculators