Calculators
Polygon Diagonal Calculator
Count the diagonals of a polygon from its number of sides using exact browser-only arithmetic.
Count diagonals joining nonadjacent vertices of a simple polygon with at least three sides. Enter up to 100 decimal digits. Results use exact integers and stay in your browser.
How to count polygon diagonals
For a simple polygon with n sides, each vertex connects by diagonals to n − 3 other vertices: exclude itself and its two neighbors. Multiplying by n counts each diagonal twice, so the total is n(n − 3)/2. A triangle has 0 diagonals, a quadrilateral has 2, and a hexagon has 9. There are n(n − 1)/2 total vertex pairs, including the n edges. The count applies to both regular and irregular simple polygons; in concave polygons some diagonals can lie outside the boundary. It counts vertex connections, not their lengths, intersection points, or regions. Enter a whole number of at least 3 using up to 100 decimal digits. Leading zeros and surrounding whitespace are accepted; signs, decimals, separators and exponent notation are rejected. Exact BigInt arithmetic preserves every digit. All processing runs locally in your browser.
Frequently Asked Questions
Everything you need to know about this tool, how it works, and privacy.
What is the formula for polygon diagonals?
A polygon with n sides has n(n − 3)/2 diagonals, with n − 3 diagonals from each vertex.
How many diagonals does a hexagon have?
A hexagon has 6 × 3 / 2 = 9 diagonals. Three start from each vertex.
Does the polygon need to be regular?
No. The vertex-pair count applies to any simple polygon. In a concave polygon, some diagonals lie outside its boundary.
Does this calculate diagonal lengths?
No. Side count determines the number of diagonals, but lengths require additional geometry.
Can I enter very large side counts?
Yes. Enter up to 100 decimal digits. Exact integer arithmetic avoids floating-point rounding.