Skip to content
CalculatorAtlas

Diagonal Length Calculator

Tested

Diagonal of a rectangle or the space diagonal of a box.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

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

  1. Enter length (above 0).
  2. Enter width (above 0).
  3. Optionally, enter height (for a box) (above 0).
  4. Press Calculate to see the result, and use Reset to start again.
Inputs of the Diagonal Length Calculator
InputWhat to enterAllowed values
LengthA number> 0
WidthA 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.

Results of example 1
ResultValue
Diagonal5
Space diagonal—

Example 2

Inputs: Length = 1; Width = 1.

Results of example 2
ResultValue
Diagonal1.414214
Space diagonal—

Example 3

Inputs: Length = 2; Width = 3; Height (for a box) = 6.

Results of example 3
ResultValue
Diagonal3.605551
Space diagonal7

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.

How the result changes with length
LengthDiagonalSpace diagonal
1.54.272002—
35—
67.211103—
1212.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.

Choosing between the Diagonal Length Calculator and similar calculators
CalculatorYou enterIt returns
[Arc Length Calculator](/math/arc-length-calculator/)radius and central angleArc length
[Diagonal of a Rectangle Calculator](/math/diagonal-of-rectangle/)length and widthDiagonal
[Square Diagonal Calculator](/math/square-diagonal/)sideSquare Diagonal
[Chord Length Calculator](/math/chord-length/)radius and central angleChord length
[Area Calculator](/math/area-calculator/)shape and aArea

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.

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.