Polygon Diagonals Calculator
- From each of the 6 vertices you can draw 3 diagonals (excluding itself and its two neighbours), giving 6 × 3 = 18 — but every diagonal is counted twice, once from each end.
- Dividing by two: 18 ÷ 2 = 9 diagonals in total.
- Those diagonals carve the polygon into 4 triangles from a single vertex — the same fact that fixes the interior angle sum at (6 − 2) × 180°.
If you have ever wondered how many diagonals does a polygon have, this calculator gives you the answer instantly. Enter the number of sides, and the tool applies the standard formula n(n − 3) ÷ 2 to return the total count. The logic is straightforward: each vertex connects to n − 3 diagonals, excluding itself and its two neighbours. Multiplying by n counts every diagonal twice, since each one links two vertices, so the result is divided by 2. The calculator has been verified against known cases: a hexagon (6 sides) has 9 diagonals, 3 from each vertex; a nonagon (9 sides) has 27 diagonals; and a dodecagon (12 sides) has 54 diagonals.
This method is the accepted standard for counting diagonals because it accounts for every vertex connection exactly once. The same reasoning explains why diagonals from one vertex split the polygon into n − 2 triangles, the fact behind the interior angle sum. This page shows the formula, step-by-step workings, worked examples, and sources so you can follow the full calculation and confirm the results yourself.
Worked examples
Hexagon (6 sides)
9 diagonals in total, 3 from each vertex, splitting the hexagon into 4 triangles. (6)
| Diagonals | 9 |
| Diagonals from each vertex | 3 |
| Triangles formed from one vertex | 4 |
Nonagon (9 sides)
27 diagonals — the count grows much faster than the side count. (9)
| Diagonals | 27 |
| Diagonals from each vertex | 6 |
| Triangles formed from one vertex | 7 |
Dodecagon (12 sides)
54 diagonals, 9 from every vertex. (12)
| Diagonals | 54 |
| Diagonals from each vertex | 9 |
| Triangles formed from one vertex | 10 |
The formula and why it works
The number of diagonals in an n-sided polygon is n(n − 3) ÷ 2. To see why this formula works, start at any single vertex of the polygon. From that vertex, a diagonal can run to every other vertex except itself and its two immediate neighbors. That leaves n − 3 possible endpoints, so each vertex connects to n − 3 diagonals.
Since the polygon has n vertices, multiplying n × (n − 3) seems like it should give the total. But this count includes every diagonal twice — once from each endpoint. A diagonal running from vertex A to vertex B gets counted when you stand at A, and again when you stand at B. Dividing by 2 corrects for this double counting, which is why the final formula is n(n − 3) ÷ 2.
This same vertex-by-vertex reasoning shows up in another classic polygon fact. The diagonals drawn from one vertex split the polygon into n − 2 triangles — the same fact behind the interior angle sum formula. So the structure that lets you count triangles also helps you count diagonals, since both come from looking at what a single vertex can reach.
You can check the formula against real polygons. A hexagon (6 sides) has 9 diagonals, with 3 running from each vertex: 6 × 3 ÷ 2 = 9. A nonagon (9 sides) has 27 diagonals: 9 × 6 ÷ 2 = 27. And a dodecagon (12 sides) has 54 diagonals: 12 × 9 ÷ 2 = 54. Each result matches the formula exactly.
- A hexagon (6 sides): 6 × 3 ÷ 2 = 9 diagonals
- A nonagon (9 sides): 9 × 6 ÷ 2 = 27 diagonals
- A dodecagon (12 sides): 12 × 9 ÷ 2 = 54 diagonals
Worked examples
The formula n(n − 3) ÷ 2 gives a quick answer to the question of how many diagonals does a polygon have, but seeing it applied to real shapes makes the logic far easier to follow. The table below walks through three verified examples — a hexagon, a nonagon, and a dodecagon — showing both the total count and the number of diagonals that originate from a single vertex in each case.
Each vertex connects to n − 3 diagonals because you exclude the vertex itself and its two immediate neighbors. For a hexagon, that means 3 diagonals from each vertex. Multiplying by 6 vertices gives 18, but since every diagonal gets counted twice — once from each end — you divide by 2 to reach the verified total of 9. The same reasoning scales cleanly to larger polygons, as the nonagon and dodecagon entries demonstrate.
The per-vertex count also ties into a related geometric fact. Diagonals drawn from one vertex split the polygon into n − 2 triangles, the same principle behind the interior angle sum formula. A hexagon, for instance, divides into 4 triangles from a single vertex, while a dodecagon divides into 10. This triangle-splitting perspective helps explain why the diagonal count grows so quickly as the number of sides increases.
Notice how rapidly the total rises: moving from 6 sides to 12 sides doubles the vertex count, but the number of diagonals increases sixfold, from 9 to 54. That steep growth comes from the n(n − 3) term, which is quadratic rather than linear. A polygon with twice as many sides has far more than twice as many diagonals, which is why larger polygons can contain surprisingly high counts even though each vertex only connects to a modest number of them.
| Polygon | Sides (n) | Diagonals from each vertex (n − 3) | Total diagonals n(n − 3) ÷ 2 |
|---|---|---|---|
| Hexagon | 6 | 3 | 9 |
| Nonagon | 9 | 6 | 27 |
| Dodecagon | 12 | 9 | 54 |
Diagonals grow faster than sides
Diagonals grow faster than sides
The number of diagonals in an n-sided polygon is n(n − 3) ÷ 2. That formula reveals something important: diagonals do not increase at the same rate as sides. They grow quadratically, which means that when you double the number of sides, you roughly quadruple the number of diagonals. A triangle has 0 diagonals, a square has 2, and a pentagon has 5 — but the count accelerates quickly from there.
To see why, think from the perspective of a single vertex. Each vertex connects to n − 3 diagonals, excluding itself and its two immediate neighbors. Multiplying by n gives the total connections, but this counts every diagonal twice — once from each endpoint — so you divide by 2. This is the same logic behind another polygon fact: diagonals from one vertex split the polygon into n − 2 triangles, which is the basis for the interior angle sum formula.
If you are wondering how many diagonals does a polygon have as the side count climbs, the numbers make the point clearly. A hexagon (6 sides) has 9 diagonals, with 3 coming from each vertex. A nonagon (9 sides) has 27 diagonals. A dodecagon (12 sides) has 54 diagonals. Each step adds more sides, but the diagonal count jumps even faster because every new vertex can connect to nearly all the existing ones.
The growth becomes dramatic at larger scales. A 100-gon has 4,850 diagonals — far beyond what intuition might suggest for a shape with 100 sides. The quadratic relationship means that adding sides to an already large polygon produces an ever-larger surge in diagonals, which is why the formula matters more than simply counting by hand.
Diagonals and triangulation
Diagonals do more than connect vertices — they reveal the internal structure of a polygon. When you draw every diagonal from a single vertex, those lines split the polygon into smaller pieces. Specifically, an n-sided polygon breaks into n − 2 triangles. This is the same fact behind the interior angle sum formula, because each triangle contributes 180 degrees, giving a total of (n − 2) × 180 degrees. So when someone asks how many diagonals does a polygon have, the answer ties directly into how the shape can be broken down and measured.
The diagonal formula n(n − 3) ÷ 2 grows from this same vertex-by-vertex thinking. Each vertex connects to n − 3 diagonals, excluding itself and its two neighboring vertices. Multiply that by n vertices and you have counted every diagonal twice — once from each end — so you divide by 2 to get the correct total. A hexagon illustrates this neatly: with 6 sides, each vertex sends out 3 diagonals, and 6 × 3 ÷ 2 gives 9 diagonals total.
Triangulation also underpins practical area methods. Because the diagonals from one vertex divide the polygon into n − 2 triangles, you can calculate the total area by finding the area of each triangle and adding them together. Surveyors, computer graphics programs, and engineering tools all rely on this approach when working with irregular shapes. The diagonal count and the triangle count are two sides of the same geometric coin.
Larger polygons follow the same pattern without exception. A nonagon (9 sides) has 27 diagonals, and a dodecagon (12 sides) has 54 diagonals. In each case, the diagonals from any single vertex slice the shape into n − 2 triangles — 7 triangles for the nonagon and 10 for the dodecagon. Whether you are checking an angle sum, estimating area, or simply counting line segments, the relationship between diagonals and triangulation stays consistent across every polygon.
Diagonals in real structures
Diagonals in real structures
If you have ever seen a metal gate with a crossbar running corner to corner, you have watched geometry hold up against gravity. A four-sided frame by itself is wobbly because a quadrilateral can flex at its joints without changing the length of any side. Add one diagonal brace and the frame locks tight. That single piece turns two triangles out of the quadrilateral, and triangles cannot deform without stretching or compressing their sides. This is why engineers and carpenters rely on diagonal bracing in everything from fence gates to wooden deck framing.
The same logic scales up to larger polygons used in trusses and architectural supports. The number of diagonals in an n-sided polygon is n(n − 3) ÷ 2, so a builder working with a six-sided panel has 9 possible diagonal braces to choose from. Each vertex connects to n − 3 diagonals, excluding itself and its two neighbors, and multiplying by n counts every diagonal twice, hence the division by 2. Knowing how many diagonals does a polygon have helps designers figure out where to place internal members so the structure stays rigid without adding unnecessary weight or material.
In practical terms, not every diagonal needs to be present for a structure to hold firm. A hexagon has 9 diagonals available, 3 from each vertex, but a truss designer may use only a subset of them to triangulate the frame. The key insight is that diagonals from one vertex split the polygon into n minus 2 triangles, which is the same fact behind the interior angle sum formula. Triangulation is what makes a polygon stable, and each diagonal added to the frame creates another triangle that resists shearing forces.
Larger polygonal frames follow the same rules but offer more bracing options. A nonagon, with 9 sides, has 27 diagonals available for structural reinforcement. A dodecagon, with 12 sides, has 54 diagonals. In large domes, geodesic frameworks, and architectural facades, these internal members distribute loads across multiple paths rather than concentrating force at a single joint. The result is a structure that can bear significant weight while remaining lightweight, because the diagonal members carry tension and compression efficiently along their length.
Whether the project is a simple garden gate or a complex roof truss, the principle remains the same. A polygon without diagonals can shift and collapse under load, but diagonals convert flexible shapes into rigid networks of triangles. Builders who understand this can look at any polygonal frame and know exactly where to add bracing to keep it standing strong.
Common mistakes
When people ask how many diagonals does a polygon have, they often arrive at the wrong answer because of a few common mistakes. The first is counting the sides themselves as diagonals. A diagonal connects two non-adjacent vertices, so the two edges that meet at a vertex are never diagonals. If you include those two sides, you will overcount and get a total that is too high. Remember that each vertex connects to n − 3 diagonals because you exclude the vertex itself and its two neighbours.
The second common mistake is forgetting to divide by 2. Each vertex connects to n − 3 diagonals, so multiplying by n gives you the total number of diagonal endpoints. However, this counts every diagonal twice — once from each end — so you must divide by 2. The formula n(n − 3) ÷ 2 exists precisely because of this double counting. Skip the division and you will double your result. For example, a hexagon has 6 sides, and 6(6 − 3) = 18. Divide by 2 and you get 9 diagonals, which is correct. Forget to divide and you would wrongly conclude there are 18.
A third mistake involves applying the formula to concave polygons and expecting it to account for diagonals that fall outside the shape. The formula n(n − 3) ÷ 2 still gives the correct count of all diagonals, including those that pass through the exterior of a concave polygon. The confusion arises when people visually inspect a concave shape and miss diagonals that extend outside its boundary. Whether the diagonal lies inside or outside the polygon, it still counts. A nonagon (9 sides) has 27 diagonals and a dodecagon (12 sides) has 54 diagonals regardless of whether the shapes are convex or concave.
A final pitfall is confusing diagonals with the triangles formed when drawing them. Diagonals from one vertex split the polygon into n − 2 triangles, which is the same fact behind the interior angle sum formula. Some people mistakenly use n − 2 as the diagonal count. That number gives the triangles, not the diagonals. The diagonal count from one vertex is n − 3, not n − 2, because the two adjacent sides do not produce diagonals.
FAQs
How many diagonals does a hexagon have?
A hexagon has 9 diagonals. You can find this using the standard formula: 6 × (6 − 3) ÷ 2 = 9. A hexagon has six sides and six vertices, so plugging that value into the diagonal formula gives you the total number of diagonals quickly and accurately.
What is the formula for the number of diagonals?
The formula is n(n − 3) ÷ 2 for an n-sided polygon. Here, n is the number of sides. You subtract 3 because no diagonal connects a vertex to itself or to either adjacent vertex. For example, a dodecagon gives 12 × 9 ÷ 2 = 54 diagonals.
Why do you divide by 2?
You divide by 2 because counting from every vertex counts each diagonal twice — once from each end. Without dividing, you would double every diagonal in your total. Dividing by 2 corrects this and gives you the true number of diagonals in any polygon.
How many diagonals come from one vertex?
From a single vertex, the number of diagonals is n − 3. You subtract 3 because a vertex does not connect to itself or to its two neighboring vertices. For example, there are three from each hexagon vertex, and nine from each dodecagon vertex.
Does the formula work for concave polygons?
Yes, the formula works for concave polygons. The count is the same, though some diagonals of a concave polygon fall outside the shape. The formula depends only on the number of sides, not on whether the polygon is convex or concave, so the total remains correct.
How many diagonals does a 20-sided polygon have?
A 20-sided polygon has 170 diagonals. Using the formula, you get 20 × 17 ÷ 2 = 170, showing how fast the count grows as the number of sides increases. A polygon with 20 sides has far more diagonals than smaller polygons like hexagons or octagons.