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.

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.

Why Use This Diagonal Calculator — Rectangle, Cube, Polygon & More?

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.

How to Use This Calculator

  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

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

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

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.

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

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.

Frequently Asked Questions

What is the formula for the diagonal of a rectangle?

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

What is the difference between a face diagonal and a space diagonal?

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²)).

How many diagonals does a polygon have?

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.

Why is a square's diagonal s√2?

Because a square has sides a = b = s, so d = √(s² + s²) = √(2s²) = s√2 ≈ 1.414s.

How do I find the longest diagonal of a regular polygon?

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.

Can I use the diagonal to calculate area?

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.

Related Pages