Calculate the diagonal of a rectangle, square, cube, cuboid, or regular polygon. Find face diagonals, space diagonals, angles, and the number of diagonals.
The diagonal of a shape is a straight line connecting two non-adjacent vertices. It is one of the most fundamental measurements in geometry, appearing everywhere from screen sizes (measured diagonally) to structural bracing in construction.
For 2D shapes, the diagonal is calculated using the Pythagorean theorem. A rectangle with sides a and b has a diagonal of √(a² + b²). A square with side s has a diagonal of s√2 — a fact used constantly in carpentry, tiling, and manufacturing. Regular polygons with n sides have n(n−3)/2 diagonals of varying lengths, with the longest running through the center.
For 3D shapes, things get more interesting. A cube with edge s has face diagonals of s√2 and a space diagonal of s√3. A cuboid (rectangular prism) with edges a, b, and c has three distinct face diagonals (one per pair of faces) and a space diagonal of √(a² + b² + c²). The space diagonal is always the longest straight line that fits inside the box — a fact critical in packaging and shipping.
This calculator handles all five shape types: rectangle, square, cube, cuboid, and regular polygon. For each, it computes the diagonal length, the number of diagonals, the diagonal-to-side ratio, area or surface area, perimeter, and the angle the diagonal makes. Presets cover real-world objects like TVs, dice, shipping boxes, and tiles. A formula reference table is included for quick study.
The Diagonal Calculator — Rectangle, Cube, Polygon & More is useful when you need fast and consistent geometry results without reworking the same algebra repeatedly. It helps you move from raw measurements to Number of Diagonals, Diagonal-to-Side Ratio, Perimeter / Edge Sum in one pass, with conversions and derived values shown together.
Use it to validate homework steps, check CAD or fabrication dimensions, estimate material requirements, and sanity-check hand calculations before submitting work.
Rectangle: d = √(a² + b²) Square: d = s√2 Cube (face diagonal): d_f = s√2 Cube (space diagonal): d_s = s√3 Cuboid (space diagonal): d = √(a² + b² + c²) Cuboid (face diag.): √(a²+b²), √(a²+c²), √(b²+c²) Regular n-gon: number of diags = n(n−3)/2, longest diag via circumradius R = s/(2 sin(π/n))
Result: Space diagonal = 13, face diagonals = 5, 12.37, 12.65
For a cuboid 3 × 4 × 12: space diagonal = √(9 + 16 + 144) = √169 = 13. Face diagonals: 3×4 face → √(9+16) = 5; 3×12 face → √(9+144) ≈ 12.37; 4×12 face → √(16+144) ≈ 12.65.
This calculator combines the core geometry formula with the input mode selected in the interface, then derives companion values shown in the output cards, comparison bars, and reference tables. Use it to cross-check both direct calculations and reverse-solving scenarios where one measurement is unknown.
Diagonal Calculator — Rectangle, Cube, Polygon & More calculations show up in coursework, drafting, construction layout, packaging, tank sizing, machining, and quality control. Instead of solving each transformation manually, you can test scenarios quickly and verify whether your dimensions remain within tolerance.
Keep units consistent across every input before interpreting area, perimeter, angle, or volume outputs. For best results, measure carefully, round only at the final step, and compare at least one manual calculation with the calculator output when building confidence.
The diagonal d = √(a² + b²), where a and b are the length and width. This comes directly from the Pythagorean theorem.
A face diagonal lies on one face of a 3D solid (like √(a² + b²) on the bottom face of a box). A space diagonal passes through the interior, connecting opposite vertices (√(a² + b² + c²)).
A polygon with n sides has n(n − 3) / 2 diagonals. A triangle has 0, a square has 2, a pentagon has 5, a hexagon has 9, a decagon has 35.
Because a square has sides a = b = s, so d = √(s² + s²) = √(2s²) = s√2 ≈ 1.414s.
For an even-sided polygon, it's 2R where R is the circumradius = s / (2 sin(π/n)). For odd-sided polygons, no diagonal passes through the center, but the longest is close to 2R.
For a square: area = d²/2. For a rectangle, you also need the length-to-width ratio or one side. For a rhombus: area = (d₁ × d₂) / 2.