Diagonal Calculator
Calculate the diagonal of a rectangle, square, or cube from side lengths. Enter values for instant results with step-by-step formulas.
Reviewed for accuracy by Manoj Kumar, Mathematics Educator
Diagonal Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: Rectangle: d = sqrt(l^2 + w^2) | Square: d = s x sqrt(2) | Cube: d = s x sqrt(3)
Worked example โ Diagonal: 55.0 inches | This confirms the standard 55-inch TV size
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: 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
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) 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
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.
How many diagonals does a polygon have?
The number of diagonals in a convex polygon with n sides is given by the formula n(n-3)/2. This formula works because each vertex can connect to (n-3) other vertices to form a diagonal (excluding itself and its two adjacent vertices), giving n(n-3) connections, and dividing by 2 avoids counting each diagonal twice. A triangle has 0 diagonals, a quadrilateral has 2, a pentagon has 5, a hexagon has 9, and a decagon has 35. For regular polygons, the diagonals have specific length relationships to the side length based on the golden ratio and trigonometric functions. The total number of diagonals grows quadratically with the number of sides, and in many polygons the diagonals intersect at interior points creating additional geometric features that are useful in design and analysis.
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.
How does screen size relate to diagonal measurement?
Television, monitor, and phone screen sizes are universally specified by their diagonal measurement rather than their width or height. This convention dates back to the early days of cathode ray tube (CRT) televisions, where the circular tube diameter was the most natural measurement, and the diagonal of the rectangular image area approximately equaled the tube diameter. For modern displays, knowing the diagonal and the aspect ratio (such as 16:9 for widescreen or 4:3 for traditional) allows you to calculate the actual width and height. For a 55-inch 16:9 TV, the width is approximately 47.9 inches and the height is approximately 27.0 inches. This calculation uses the formulas width = diagonal times cos(arctan(9/16)) and height = diagonal times sin(arctan(9/16)).
What is the relationship between diagonals and the Pythagorean theorem?
The Pythagorean theorem is the mathematical foundation for all diagonal calculations in Euclidean geometry. The theorem states that in a right triangle, the square of the hypotenuse equals the sum of the squares of the other two sides (a squared + b squared = c squared). When calculating a rectangle diagonal, the length and width are the two legs of a right triangle, and the diagonal is the hypotenuse. For three-dimensional shapes, the theorem is applied iteratively: first to find a face diagonal from two edges, then using that face diagonal and the third edge to find the space diagonal. This gives the generalized formula d = sqrt(a squared + b squared + c squared) for three dimensions, and it extends to any number of dimensions as d = sqrt(sum of squared edge lengths). The Pythagorean theorem connects diagonal calculations to distance formulas in coordinate geometry.
How do you find the side length from the diagonal?
Working backwards from the diagonal to find side lengths requires knowing the shape type and at least one other measurement. For a square, if the diagonal d is known, the side length s = d divided by sqrt(2), or equivalently s = d times sqrt(2) divided by 2. For a rectangle, knowing the diagonal and one side allows calculation of the other: if the diagonal is d and the length is l, then the width w = sqrt(d squared minus l squared). For a cube, the edge length from the space diagonal is s = d divided by sqrt(3). For a rectangular prism, you need the space diagonal and two of the three dimensions to calculate the third: if d, l, and w are known, then h = sqrt(d squared minus l squared minus w squared). These inverse calculations are common in engineering when a maximum diagonal clearance is specified and the designer needs to determine allowable dimensions.
References
Reviewed for accuracy by Manoj Kumar, Mathematics Educator ยท Editorial policy
Related Calculators
๐งฎArea of a Rectangle Calculator
Calculate the area, perimeter, and diagonal of a rectangle. Find missing sides from known area. Convert between metric and imperial area units.
๐งฎAnnulus Area Calculator
Calculate annulus area with inputs, formulas, and instant results.
๐งฎArea Calculator
Calculate area with inputs, formulas, and instant results.
๐งฎArea of Crescent Calculator
Calculate area of crescent with inputs, formulas, and instant results.
๐งฎCenter of Mass Calculator
Calculate center of mass with inputs, formulas, and instant results.
๐งฎCentroid Calculator
Calculate centroid with inputs, formulas, and instant results.
๐งฎChord Length Calculator
Calculate chord length with inputs, formulas, and instant results.
๐งฎConic Sections Calculator
Calculate conic sections with inputs, formulas, and instant results.