Diagonal Calculator — Rectangle, Cube, Polygon & More

Calculate the diagonal of a rectangle, square, cube, cuboid, or regular polygon. Find face diagonals, space diagonals, angles, and the number of diagonals.

cm
cm
Planning notes, formulas, and examples

About the Diagonal Calculator — Rectangle, Cube, Polygon & More

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.

When This Page Helps

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.

How to Use the Inputs

  1. Select the shape type: rectangle, square, cube, cuboid, or regular polygon.
  2. Pick a measurement unit (mm, cm, in, m, ft).
  3. Enter the necessary dimensions: side length for squares/cubes, or length/width/height for rectangles/cuboids.
  4. For regular polygons, also enter the number of sides (n ≥ 3).
  5. Or click a preset to load a common real-world example.
  6. View the diagonal length, number of diagonals, area, perimeter, and angle.
  7. For 3D shapes, compare face diagonals and space diagonal in the bar chart.
Formula used
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))

Example Calculation

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.

Tips & Best Practices

  • TV and monitor sizes are measured diagonally — a 55" TV is 55 inches from corner to corner.
  • To check if a room is square, measure both diagonals. They should be equal if all corners are 90°.
  • The space diagonal of a cube is always s√3 ≈ 1.732 × the side length.
  • In a regular hexagon, the longest diagonal equals exactly 2× the side length.
  • Diagonal bracing in construction uses the Pythagorean theorem — that's why it makes structures rigid.

How This Diagonal Calculator — Rectangle, Cube, Polygon & More Works

Where It Helps In Practice

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.

Accuracy And Setup Tips

Sources & Methodology

Last updated:

Frequently Asked Questions

  • The diagonal d = √(a² + b²), where a and b are the length and width. This comes directly from the Pythagorean theorem.