Quick answer
A rectangle's diagonal is √(a² + b²) and a box's space diagonal is √(a² + b² + c²). A 3 × 4 rectangle has a diagonal of 5.
Enter the length and width, and optionally the height. The calculator returns the diagonal and space diagonal.
Related tools: Arc Length Calculator: Length of a circular arc. Diagonal of a Rectangle Calculator: Diagonal length of a rectangle. Square Diagonal Calculator: Diagonal of a square.
How to use the Diagonal Length Calculator
- Enter length (above 0).
- Enter width (above 0).
- Optionally, enter height (for a box) (above 0).
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Length | A number | > 0 |
| Width | A number | > 0 |
| Height (for a box) (optional) | A number | > 0 |
Formula and method
Formula
diagonal = √(a² + b²); space diagonal = √(a² + b² + c²)
IEEE-754 double precision; shown to the decimals indicated.
Pythagorean theorem.
Worked examples
These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.
Example 1
Inputs: Length = 3; Width = 4.
| Result | Value |
|---|---|
| Diagonal | 5 |
| Space diagonal | — |
Example 2
Inputs: Length = 1; Width = 1.
| Result | Value |
|---|---|
| Diagonal | 1.414214 |
| Space diagonal | — |
Example 3
Inputs: Length = 2; Width = 3; Height (for a box) = 6.
| Result | Value |
|---|---|
| Diagonal | 3.605551 |
| Space diagonal | 7 |
The first line is the headline result (diagonal). Below it the diagonal Length Calculator lists space diagonal, which describe the same case from other angles. IEEE-754 double precision; shown to the decimals indicated.
Pythagoras in two and three dimensions
For 3 × 4: √(9 + 16) = 5. With a height of 12 the space diagonal is √(9 + 16 + 144) = 13, a classic Pythagorean quadruple (3, 4, 12, 13).
Uses
Check a TV or monitor size from its width and height, or whether a long item fits in a box. Use the same unit for all sides.
How the result changes with length
Holding every other input at the first worked example, this table changes only length. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.
| Length | Diagonal | Space diagonal |
|---|---|---|
| 1.5 | 4.272002 | — |
| 3 | 5 | — |
| 6 | 7.211103 | — |
| 12 | 12.649111 | — |
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- Length: entering "0" shows "Length must be greater than 0." beside that field and no result.
- Width: left empty shows "Enter width." beside that field and no result.
Choosing between the Diagonal Length Calculator and similar calculators
Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.
| Calculator | You enter | It returns |
|---|---|---|
| [Arc Length Calculator](/math/arc-length-calculator/) | radius and central angle | Arc length |
| [Diagonal of a Rectangle Calculator](/math/diagonal-of-rectangle/) | length and width | Diagonal |
| [Square Diagonal Calculator](/math/square-diagonal/) | side | Square Diagonal |
| [Chord Length Calculator](/math/chord-length/) | radius and central angle | Chord length |
| [Area Calculator](/math/area-calculator/) | shape and a | Area |
Background: geometry measurements
Geometry results carry units that depend on the quantity: a perimeter or length is in linear units such as cm, an area or surface area is in square units (cm²) and a volume is in cubic units (cm³). Use one length unit for every input, because the calculator multiplies the numbers as given.
Flat (2D) shapes have an area and a perimeter; solids (3D) have a surface area and a volume. Two familiar checks: a circle of radius r has area πr² and circumference 2πr, and a sphere has volume (4/3)πr³ and surface area 4πr².
Assumptions and limitations
- Same unit for all sides
If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for length and width to confirm this.
Frequently asked questions
What is the space diagonal of a 3 × 4 × 12 box?
The space diagonal is 13 units, from √(9 + 16 + 144).
Is the diagonal always longer than the sides?
Yes. The diagonal is the hypotenuse of a right triangle, so it is longer than either side.
Does it work for squares?
Yes, the diagonal is s√2.
What does the Diagonal Length Calculator calculate?
Diagonal of a rectangle or the space diagonal of a box. It returns Diagonal and Space diagonal.
What formula does the Diagonal Length Calculator use?
diagonal = √(a² + b²); space diagonal = √(a² + b² + c²). Pythagorean theorem.
What do I need to enter in the diagonal Length Calculator?
You enter Length and Width. Optional: Height (for a box).
How is the result rounded or limited?
IEEE-754 double precision; shown to the decimals indicated. Same unit for all sides.
What is an example of a diagonal Length result?
With length 3 and width 4, the diagonal is 5.
Related calculators
- Arc Length Calculator — Length of a circular arc.
- Diagonal of a Rectangle Calculator — Diagonal length of a rectangle.
- Square Diagonal Calculator — Diagonal of a square.
- Chord Length Calculator — Length of a chord from the radius and central angle.
- Area Calculator — Area of common two-dimensional shapes.
- Right Triangle Calculator — Solve a right triangle from its two legs: hypotenuse, angles, area and perimeter.
Sources
- OpenStax, Prealgebra 2e (Rice University): perimeter, area, volume, circumference and the Pythagorean theorem
Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.