Introduction
There is a simple formula for counting the diagonals of a polygon with any number of sides: multiply the number of vertices by the number three less than that, then divide by two. In symbols, the total is n(n − 3) ÷ 2, where n is the number of sides, or equivalently the number of vertices. The reasoning behind the formula is a useful lesson in counting without omissions or duplicates.
- The formula for polygon diagonals
- Why the formula works
- Examples for common polygons
- A second way to see the count
- What the formula counts in a concave polygon
- Using the formula without common mistakes
- How the number grows as a polygon gains sides
- Diagonals and dividing a convex polygon into triangles
- Conclusion
The formula for polygon diagonals
A diagonal is a straight line segment joining two vertices of a polygon that are not next to each other along its boundary. A vertex is a corner, and the sides are the boundary segments between neighboring corners. Because each side joins neighboring vertices, sides are not counted as diagonals.
For a polygon with n vertices, the number of diagonals is:
Diagonals = n(n − 3) ÷ 2
For example, a hexagon has six vertices. Substituting n = 6 gives 6(6 − 3) ÷ 2, or 6 × 3 ÷ 2 = 9 diagonals.
The rule works for polygons with three or more vertices. A triangle has three vertices, so the formula gives 3(3 − 3) ÷ 2 = 0. That makes sense: every pair of triangle vertices is already joined by a side, leaving no non-neighboring pair to form a diagonal.
Why the formula works
To understand the count, imagine choosing one vertex and drawing every diagonal that begins there. From that vertex, a segment can reach the other n − 1 vertices. But two of those vertices are its immediate neighbors, and the segments to them are sides, not diagonals. The chosen vertex itself cannot make a diagonal to itself.
After excluding those two neighboring vertices, the chosen vertex connects by diagonals to n − 3 other vertices. In a hexagon, for instance, one corner can connect diagonally to three of the other corners.
Now repeat this count for every vertex. There are n vertices, and each one has n − 3 diagonals starting from it. Multiplying gives n(n − 3). However, that counts each diagonal twice: once from each end.
For example, if a diagonal joins vertex A to vertex D, it appears in the count from A and again in the count from D. To get the number of distinct diagonals, divide by two:
n × (n − 3) ÷ 2 = n(n − 3) ÷ 2
The division is not an optional adjustment. It corrects for the fact that every diagonal has two endpoints, and the vertex-by-vertex count encounters both of them.
Examples for common polygons
The formula can be used for any polygon once its number of vertices is known. Here are several examples, with the substitution shown.
Triangle: 3(3 − 3) ÷ 2 = 0. A triangle has no diagonals.
Quadrilateral: 4(4 − 3) ÷ 2 = 2. A four-sided polygon has two diagonals.
Pentagon: 5(5 − 3) ÷ 2 = 5. A five-sided polygon has five diagonals.
Hexagon: 6(6 − 3) ÷ 2 = 9. A six-sided polygon has nine diagonals.
Octagon: 8(8 − 3) ÷ 2 = 20. An eight-sided polygon has twenty diagonals.
Decagon: 10(10 − 3) ÷ 2 = 35. A ten-sided polygon has thirty-five diagonals.
These totals count distinct segments, not the number of times they might be drawn from different starting vertices. A diagram can help check small examples, but as the number of sides grows, the formula is much quicker and less likely to miss a segment.
A second way to see the count
Another method is to count pairs of vertices. Any diagonal is formed by choosing two vertices that are not adjacent. The total number of ways to choose any two vertices from n vertices is n(n − 1) ÷ 2.
That total includes both sides and diagonals. A polygon with n vertices has n sides, so subtracting the sides leaves:
n(n − 1) ÷ 2 − n
Rearranging gives n(n − 1 − 2) ÷ 2, which simplifies to n(n − 3) ÷ 2. This arrives at the same formula by starting with all possible vertex pairs and removing the neighboring pairs.
The two approaches highlight different parts of the logic. The first counts diagonals from each vertex and corrects for counting them twice. The second counts all pairs of vertices and removes the pairs that make sides.
What the formula counts in a concave polygon
A polygon is convex if every interior angle is less than 180 degrees; in a simple convex polygon, every diagonal lies inside the shape. A polygon is concave if at least one interior angle is greater than 180 degrees. In a concave polygon, some segments between non-neighboring vertices may pass partly or entirely outside the polygon.
The formula still counts the segments joining non-neighboring vertices in a concave polygon. Its calculation depends on the number of vertices and which ones are neighbors along the boundary, not on whether each segment stays inside the shape. This is the usual meaning of a polygon’s total number of diagonals.
Sometimes a question asks specifically how many diagonals lie inside a concave polygon. That is a different question: the answer depends on the polygon’s shape, not just its number of sides. The formula gives the total number of non-side connections between vertex pairs, but it cannot tell which of those connections remain inside a particular concave outline.
Using the formula without common mistakes
Start by identifying n, the number of sides or vertices. For an ordinary polygon, those counts are equal. Then calculate n − 3, multiply by n, and divide by two.
For a 12-sided polygon, for example, n = 12. First, 12 − 3 = 9. Next, 12 × 9 = 108. Finally, 108 ÷ 2 = 54 diagonals.
A frequent mistake is to use n(n − 3) as the final answer without dividing by two. That intermediate result counts each diagonal from both endpoints. Another mistake is to subtract only one neighbor. Each vertex has two neighbors, one on either side, and both connecting segments are sides.
It can also help to check whether the result is reasonable. A triangle should give zero, and a quadrilateral should give two. The final answer should be a whole number, since diagonals come in countable segments. For integer values of n of three or more, the formula produces an integer.
How the number grows as a polygon gains sides
Adding one side does not add just one diagonal. A new vertex can connect to several existing vertices, and diagonals that were already possible among the old vertices remain. This is why the total rises more quickly than the number of sides.
The increase from an n-sided polygon to an (n + 1)-sided polygon is n − 1 diagonals. This can be seen from the formula: the new polygon has one more vertex, which creates new connections to the existing vertices, while the boundary changes also affect which connections count as diagonals.
For example, a pentagon has five diagonals and a hexagon has nine, an increase of four. Moving from a hexagon to a heptagon raises the count from nine to fourteen, an increase of five. Each additional side makes the next increase larger by one.
This pattern reflects the number of possible pairs among a growing set of vertices. As the set gets larger, there are more ways to choose two vertices, so the total number of possible diagonals grows roughly in proportion to the square of the number of sides for large polygons.
Diagonals and dividing a convex polygon into triangles
In a convex polygon, diagonals can be used to divide the shape into smaller triangles. Drawing all the diagonals from a single vertex creates n − 2 triangles. For example, drawing diagonals from one corner of a hexagon divides it into four triangles.
This does not mean that a polygon has only n − 2 diagonals. It describes one particular way to divide a convex polygon: use diagonals from one chosen vertex and stop when the interior is separated into triangles. The total formula counts every possible diagonal in the polygon, including diagonals that are not needed for that one division.
This distinction is useful when interpreting geometry questions. “How many diagonals does the polygon have?” asks for all non-side connections between pairs of vertices. “How many diagonals are needed to divide a convex polygon into triangles from one vertex?” asks for a specific construction, whose count is n − 3.
Conclusion
The number of diagonals in a polygon with n sides is n(n − 3) ÷ 2. Each vertex connects diagonally to all but itself and its two neighbors, giving n − 3 possible diagonals from that corner. Counting from every vertex counts each segment twice, so dividing by two gives the total. The same rule applies to convex and concave polygons when diagonals mean segments joining non-neighboring vertices.

