UTILS.
Private by default
📐

Diagonal Calculator

Find the diagonal of a rectangle, square or 3D box, or get the width and height of a screen from its diagonal and aspect ratio.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

Calculate diagonals four ways: a rectangle from its length and width, a square from its side, a 3D box from its three edges, or the real width and height of a screen from its diagonal and aspect ratio. Everything is computed in your browser.

The diagonals use the Pythagorean theorem: a rectangle is √(l² + w²), a square is s·√2, and a box's space diagonal is √(l² + w² + h²). For screen sizing with an aspect ratio w:h (for example 16:9), the scale factor is diagonal / √(w² + h²); the width is w × scale, the height is h × scale, and the display area is width × height.

The screen mode is ideal for TVs and monitors: enter a 50 inch diagonal at 16:9 to see it measures about 43.6 by 24.5 inches. The other modes also report area, perimeter, volume or surface area where they apply.

Frequently asked questions

How is a rectangle's diagonal calculated?
By the Pythagorean theorem: diagonal = √(length² + width²). A square is the special case s·√2 where length equals width.
What is the space diagonal of a box?
The longest straight line inside a rectangular box, corner to opposite corner, equal to √(length² + width² + height²).
How does the screen-size mode work?
It scales the aspect ratio to the given diagonal: scale = diagonal / √(w² + h²), then width = w × scale and height = h × scale, so a 16:9 50-inch TV is about 43.6 by 24.5 inches.
Do the units matter?
No. Diagonals are unit-agnostic — inches in gives inches out. Just keep every measurement in the same unit within one calculation.

More tools