Skip to main content

Diagonal Calculator

Calculate the diagonal of a rectangle, square, or cube from side lengths. Enter values for instant results with step-by-step formulas.

Skip to calculator
Mathematics

Diagonal Calculator

Calculate the diagonal of a rectangle, square, cube, or rectangular prism from side lengths. Find face diagonals, space diagonals, and related properties.

Last updated: December 2025Reviewed by NovaCalculator Mathematics Team

Calculator

Adjust values & calculate
8
6
Rectangle Diagonal
10.000000 units
d = sqrt(l^2 + w^2)
Diagonal
10.000000
units
Area
48.0000
sq units
Perimeter
28.0000
units
Angle with length
36.87
degrees
Aspect Ratio
1.3333
Your Result
Rectangle Diagonal: 10.000000 units | Formula: d = sqrt(l^2 + w^2)
Share Your Result
Understand the Math

Formula

Rectangle: d = sqrt(l^2 + w^2) | Square: d = s x sqrt(2) | Cube: d = s x sqrt(3)

Diagonal calculations use extensions of the Pythagorean theorem. For 2D shapes, the diagonal is the hypotenuse of a right triangle formed by the sides. For 3D shapes, the space diagonal extends through the interior connecting opposite vertices using all three dimensions.

Last reviewed: December 2025

Worked Examples

Example 1: TV Screen Size Calculation

A TV has a 16:9 aspect ratio with dimensions of 47.9 inches wide and 27.0 inches tall. What is the screen diagonal?
Solution:
Using the rectangle diagonal formula: d = sqrt(l^2 + w^2) d = sqrt(47.9^2 + 27.0^2) d = sqrt(2294.41 + 729.00) d = sqrt(3023.41) d = 54.99 inches (marketed as 55 inches)
Result: Diagonal: 55.0 inches | This confirms the standard 55-inch TV size

Example 2: Shipping Box Space Diagonal

A shipping box measures 24 inches long, 18 inches wide, and 12 inches tall. What is the longest item (placed diagonally) that can fit inside?
Solution:
Space diagonal = sqrt(l^2 + w^2 + h^2) d = sqrt(24^2 + 18^2 + 12^2) d = sqrt(576 + 324 + 144) d = sqrt(1044) d = 32.31 inches Face diagonal (base) = sqrt(576 + 324) = sqrt(900) = 30.0 inches
Result: Space Diagonal: 32.31 inches | Base Face Diagonal: 30.0 inches
Expert Insights

Background & Theory

The Diagonal Calculator applies the following established principles and formulas. Mathematics rests on a hierarchy of number systems, each extending the previous. The natural numbers (1, 2, 3, ...) support counting and ordering. The integers add negative values and zero, enabling subtraction without restriction. The rational numbers, expressible as p/q where p and q are integers and q is nonzero, close the system under division. The real numbers fill the gaps left by irrationals such as the square root of 2 or pi, forming a complete ordered field. The complex numbers, written as a + bi where i is the square root of negative one, complete the algebraic closure of the reals and allow every polynomial to have a root. Prime factorization states that every integer greater than one is uniquely expressible as a product of primes, a result known as the Fundamental Theorem of Arithmetic. Computing the greatest common divisor (GCD) of two integers relies most efficiently on the Euclidean algorithm: repeatedly replace the larger number with the remainder when it is divided by the smaller, until the remainder is zero. The last nonzero remainder is the GCD. The least common multiple (LCM) follows from the identity LCM(a, b) = |a * b| / GCD(a, b). Modular arithmetic defines equivalence classes of integers that share the same remainder under division by a modulus n. Fermat's Little Theorem and Euler's Theorem arise from this structure and underpin modern cryptography. Logarithms are the inverses of exponential functions. If b raised to the power x equals y, then the logarithm base b of y equals x. The natural logarithm uses base e, approximately 2.71828. Combinatorics counts arrangements and selections. The number of ordered arrangements (permutations) of r objects from n distinct objects is nPr = n! / (n - r)!. The number of unordered selections (combinations) is nCr = n! / (r! * (n - r)!). Pascal's triangle arranges these binomial coefficients so that each entry equals the sum of the two entries directly above it. The Fibonacci sequence, defined by F(1) = 1, F(2) = 1, and F(n) = F(n-1) + F(n-2), appears throughout nature and connects deeply to the golden ratio via Binet's formula.

History

The history behind the Diagonal Calculator traces back through the following developments. Mathematics as a systematic discipline traces to ancient Mesopotamia. Babylonian clay tablets dating to around 1800 BCE demonstrate knowledge of quadratic equations, Pythagorean triples, and base-60 arithmetic, suggesting a practical mathematical tradition far preceding Greek formalism. Euclid of Alexandria compiled the Elements around 300 BCE, establishing the axiomatic method that would define rigorous mathematics for over two thousand years. His work organized plane geometry, number theory, and proportion into logically chained propositions derived from a small set of postulates. The algorithm bearing his name for computing GCDs appears in Book VII and remains in use today. In the 9th century, the Persian scholar Muhammad ibn Musa Al-Khwarizmi wrote Al-Kitab al-mukhtasar fi hisab al-jabr wal-muqabala, the treatise whose title gave algebra its name. He systematized the solution of linear and quadratic equations and described procedures that operated on unknowns as objects, a conceptual leap away from purely numerical calculation. Rene Descartes introduced coordinate geometry in 1637 by uniting algebra and Euclidean geometry, allowing curves to be studied through equations. This synthesis set the stage for calculus. Isaac Newton and Gottfried Wilhelm Leibniz independently developed calculus during the 1660s and 1670s, triggering a priority dispute that lasted decades and divided British and Continental mathematicians. Carl Friedrich Gauss proved the Fundamental Theorem of Algebra in 1799, showing that every nonconstant polynomial has at least one complex root. His Disquisitiones Arithmeticae of 1801 established modern number theory. David Hilbert's formalist program at the turn of the 20th century sought to place all of mathematics on an explicit axiomatic foundation, a project that Kurt Godel's incompleteness theorems of 1931 showed to be fundamentally limited. Alan Turing's work in the 1930s on computability introduced the theoretical model of the stored-program computer and linked mathematical logic directly to the limits of algorithmic calculation. His proof that no algorithm can decide in general whether an arbitrary program will halt or run forever placed fundamental boundaries on what mathematics can mechanically determine, and it opened the discipline now known as theoretical computer science.

Share this calculator

Explore More

Frequently Asked Questions

A diagonal is a straight line segment that connects two non-adjacent vertices (corners) of a polygon or polyhedron. In two-dimensional shapes like rectangles and squares, the diagonal runs from one corner to the opposite corner, cutting through the interior of the shape. In three-dimensional shapes like cubes and rectangular prisms, there are two types of diagonals: face diagonals (which lie on a single face) and space diagonals (which pass through the interior of the solid from one vertex to the opposite vertex). Diagonals are calculated using the Pythagorean theorem extended to the appropriate number of dimensions. For a rectangle with length l and width w, the diagonal equals the square root of (l squared plus w squared).
The diagonal of a rectangle is found using the Pythagorean theorem since the diagonal, length, and width form a right triangle. The formula is d = sqrt(l squared + w squared), where l is the length and w is the width. For example, a rectangle with length 8 and width 6 has a diagonal of sqrt(64 + 36) = sqrt(100) = 10. A rectangle has two diagonals of equal length that bisect each other at their midpoints but are not perpendicular. The angle the diagonal makes with the length side is arctan(w/l), and with the width side is arctan(l/w). This calculation is fundamental in construction, carpentry, and design, where measuring the diagonal is used to verify that corners are perfectly square.
The diagonal of a square has a uniquely simple relationship to its side length: d = s times the square root of 2, where s is the side length. This means the diagonal is always approximately 1.4142 times the side length. The square root of 2 is an irrational number, which means even a square with integer side lengths will have an irrational diagonal length. This was one of the earliest mathematical discoveries of irrational numbers, attributed to the Pythagoreans around 500 BCE. A square has two diagonals that are equal in length and bisect each other at right angles (90 degrees), dividing the square into four congruent right triangles. Each diagonal also bisects the vertex angles, creating 45-degree angles at each corner.
The space diagonal of a cube, which runs from one vertex through the interior to the opposite vertex, is calculated as d = s times the square root of 3, where s is the edge length. This formula is derived by applying the Pythagorean theorem twice: first to find the face diagonal (s times sqrt(2)), then using that face diagonal and the edge as the two legs of a right triangle to find the space diagonal. For a cube with edge length 10, the space diagonal is 10 times sqrt(3), which equals approximately 17.32. A cube has 4 space diagonals, all equal in length, and 12 face diagonals (2 per face), each equal to s times sqrt(2). The space diagonal makes an angle of approximately 54.74 degrees with any edge it connects to.
The space diagonal of a rectangular prism (also called a cuboid or box) is calculated using the three-dimensional extension of the Pythagorean theorem: d = sqrt(l squared + w squared + h squared), where l, w, and h are the three edge lengths. This formula can be understood as a two-step process: first calculate the diagonal of the base face, then use that as one leg of a right triangle with the height as the other leg. For a box measuring 3 by 4 by 5, the space diagonal is sqrt(9 + 16 + 25) = sqrt(50) = approximately 7.07. A rectangular prism has 4 space diagonals, which are all equal in length. It also has 12 face diagonals in three groups of 4, with each group corresponding to one of the three pairs of opposite rectangular faces.
Diagonal measurement is one of the most fundamental techniques in construction for verifying that a structure is square and true. When building a rectangular foundation, deck, or frame, measuring both diagonals and confirming they are equal guarantees that all four corners are 90-degree right angles. If the diagonals are unequal, the structure is out of square, forming a parallelogram instead of a rectangle. This technique, often called cross-measuring or checking for square, has been used by builders for thousands of years. The 3-4-5 triangle method, which creates a diagonal of exactly 5 when sides are 3 and 4, is a specific application used to lay out right angles on construction sites. Modern laser measuring tools can check diagonals with millimeter precision over distances of hundreds of feet.
Educational Note: This calculator is provided for educational and informational purposes. Results are based on the formulas and inputs provided. Always verify important calculations independently. NovaCalculator processes calculator inputs client-side; optional analytics follow visitor consent settings.Reviewed by: NovaCalculator Mathematics Team โ€” Verified against standard mathematical and scientific references. Last reviewed: December 2025. ยฉ 2024โ€“2026 NovaCalculator.

Share this calculator

Formula

Rectangle: d = sqrt(l^2 + w^2) | Square: d = s x sqrt(2) | Cube: d = s x sqrt(3)

Diagonal calculations use extensions of the Pythagorean theorem. For 2D shapes, the diagonal is the hypotenuse of a right triangle formed by the sides. For 3D shapes, the space diagonal extends through the interior connecting opposite vertices using all three dimensions.

Worked Examples

Example 1: TV Screen Size Calculation

Problem: A TV has a 16:9 aspect ratio with dimensions of 47.9 inches wide and 27.0 inches tall. What is the screen diagonal?

Solution: Using the rectangle diagonal formula:\nd = sqrt(l^2 + w^2)\nd = sqrt(47.9^2 + 27.0^2)\nd = sqrt(2294.41 + 729.00)\nd = sqrt(3023.41)\nd = 54.99 inches (marketed as 55 inches)

Result: Diagonal: 55.0 inches | This confirms the standard 55-inch TV size

Example 2: Shipping Box Space Diagonal

Problem: A shipping box measures 24 inches long, 18 inches wide, and 12 inches tall. What is the longest item (placed diagonally) that can fit inside?

Solution: Space diagonal = sqrt(l^2 + w^2 + h^2)\nd = sqrt(24^2 + 18^2 + 12^2)\nd = sqrt(576 + 324 + 144)\nd = sqrt(1044)\nd = 32.31 inches\nFace diagonal (base) = sqrt(576 + 324) = sqrt(900) = 30.0 inches

Result: Space Diagonal: 32.31 inches | Base Face Diagonal: 30.0 inches

Frequently Asked Questions

What is a diagonal and how is it calculated?

A diagonal is a straight line segment that connects two non-adjacent vertices (corners) of a polygon or polyhedron. In two-dimensional shapes like rectangles and squares, the diagonal runs from one corner to the opposite corner, cutting through the interior of the shape. In three-dimensional shapes like cubes and rectangular prisms, there are two types of diagonals: face diagonals (which lie on a single face) and space diagonals (which pass through the interior of the solid from one vertex to the opposite vertex). Diagonals are calculated using the Pythagorean theorem extended to the appropriate number of dimensions. For a rectangle with length l and width w, the diagonal equals the square root of (l squared plus w squared).

How do you find the diagonal of a rectangle?

The diagonal of a rectangle is found using the Pythagorean theorem since the diagonal, length, and width form a right triangle. The formula is d = sqrt(l squared + w squared), where l is the length and w is the width. For example, a rectangle with length 8 and width 6 has a diagonal of sqrt(64 + 36) = sqrt(100) = 10. A rectangle has two diagonals of equal length that bisect each other at their midpoints but are not perpendicular. The angle the diagonal makes with the length side is arctan(w/l), and with the width side is arctan(l/w). This calculation is fundamental in construction, carpentry, and design, where measuring the diagonal is used to verify that corners are perfectly square.

What is the diagonal of a square and why is it special?

The diagonal of a square has a uniquely simple relationship to its side length: d = s times the square root of 2, where s is the side length. This means the diagonal is always approximately 1.4142 times the side length. The square root of 2 is an irrational number, which means even a square with integer side lengths will have an irrational diagonal length. This was one of the earliest mathematical discoveries of irrational numbers, attributed to the Pythagoreans around 500 BCE. A square has two diagonals that are equal in length and bisect each other at right angles (90 degrees), dividing the square into four congruent right triangles. Each diagonal also bisects the vertex angles, creating 45-degree angles at each corner.

How do you calculate the space diagonal of a cube?

The space diagonal of a cube, which runs from one vertex through the interior to the opposite vertex, is calculated as d = s times the square root of 3, where s is the edge length. This formula is derived by applying the Pythagorean theorem twice: first to find the face diagonal (s times sqrt(2)), then using that face diagonal and the edge as the two legs of a right triangle to find the space diagonal. For a cube with edge length 10, the space diagonal is 10 times sqrt(3), which equals approximately 17.32. A cube has 4 space diagonals, all equal in length, and 12 face diagonals (2 per face), each equal to s times sqrt(2). The space diagonal makes an angle of approximately 54.74 degrees with any edge it connects to.

What is the space diagonal of a rectangular prism?

The space diagonal of a rectangular prism (also called a cuboid or box) is calculated using the three-dimensional extension of the Pythagorean theorem: d = sqrt(l squared + w squared + h squared), where l, w, and h are the three edge lengths. This formula can be understood as a two-step process: first calculate the diagonal of the base face, then use that as one leg of a right triangle with the height as the other leg. For a box measuring 3 by 4 by 5, the space diagonal is sqrt(9 + 16 + 25) = sqrt(50) = approximately 7.07. A rectangular prism has 4 space diagonals, which are all equal in length. It also has 12 face diagonals in three groups of 4, with each group corresponding to one of the three pairs of opposite rectangular faces.

Why is diagonal measurement important in construction?

Diagonal measurement is one of the most fundamental techniques in construction for verifying that a structure is square and true. When building a rectangular foundation, deck, or frame, measuring both diagonals and confirming they are equal guarantees that all four corners are 90-degree right angles. If the diagonals are unequal, the structure is out of square, forming a parallelogram instead of a rectangle. This technique, often called cross-measuring or checking for square, has been used by builders for thousands of years. The 3-4-5 triangle method, which creates a diagonal of exactly 5 when sides are 3 and 4, is a specific application used to lay out right angles on construction sites. Modern laser measuring tools can check diagonals with millimeter precision over distances of hundreds of feet.

References

Reviewed by Manoj Kumar, Mathematics Educator ยท Editorial policy