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
- Right Triangle CalculatorMissing sides, angles and area of a right triangle.
- Area CalculatorArea of rectangles, circles, triangles and 5 more shapes.
- Perimeter CalculatorPerimeter and circumference of common shapes.
- Square Root CalculatorSquare root, simplest radical form and squares.
- Factor CalculatorList all factors, factor pairs and the prime factorization.
- Average CalculatorMean, median, mode and range of any list of numbers.