Polygon Diagonals: Formula, Rules & Examples

Polygon diagonals are line segments connecting two nonadjacent vertices of a polygon. For an n-sided polygon, the total number of diagonals is D = n(n − 3)/2. The formula works because each vertex can connect diagonally to n − 3 other vertices: it cannot connect to itself or to its two adjacent vertices. Multiplying n(n − 3) counts every diagonal twice, once from each endpoint, so the result is divided by 2. A triangle has no diagonals, a quadrilateral has 2, a pentagon has 5, a hexagon has 9, and the number grows quadratically as the number of sides increases. The formula can also be rearranged to determine the number of polygon sides from a known diagonal count. In regular polygons, diagonals additionally have predictable lengths, symmetry, intersection patterns, and relationships with central angles.
What Is a Polygon Diagonal?
A diagonal is a segment joining two vertices that are not next to one another.
In a pentagon with consecutive vertices:
A, B, C, D, E
segments such as:
AC
AD
are diagonals from A.
But:
AB
and:
AE
are sides, not diagonals, because B and E are adjacent to A.
A diagonal lies between nonadjacent vertices regardless of whether it passes through the polygon’s interior in a particular drawing.
Polygon Diagonals Formula
For a polygon with n sides:
D = n(n − 3)/2
where:
D = total number of diagonals
n = number of vertices or sides
Since every polygon has the same number of vertices and sides, either count can be used for n.
Basic Example: Pentagon
A pentagon has:
n = 5
Therefore:
D = 5(5 − 3)/2
= 5(2)/2
= 5
A pentagon has:
5 diagonals
Hexagon Diagonals
For a hexagon:
n = 6
Use:
D = 6(6 − 3)/2
= 6(3)/2
Therefore:
D = 9
A hexagon has:
9 diagonals
Octagon Diagonals
For:
n = 8
we get:
D = 8(8 − 3)/2
= 8(5)/2
Therefore:
D = 20
A polygon with eight sides has:
20 diagonals
Why Each Vertex Has n − 3 Diagonals
Choose one vertex of an n-gon.
That vertex cannot form a diagonal with:
itself
its adjacent vertex on one side
its adjacent vertex on the other side
Three vertices are therefore unavailable.
The number of remaining vertices is:
n − 3
Thus the number of diagonals from one vertex is:
n − 3
For a decagon:
10 − 3 = 7
diagonals can be drawn from any one vertex.
Why the Formula Divides by 2
If every vertex has:
n − 3
possible diagonal endpoints, multiplication gives:
n(n − 3)
But this counts each diagonal twice.
For example, diagonal AC is counted:
once from A to C
and:
once from C to A
These are the same geometric segment.
Therefore:
D = n(n − 3)/2
Another Derivation Using Vertex Pairs
Any pair of distinct vertices determines a segment.
The number of unordered vertex pairs is:
n(n − 1)/2
This counts:
all polygon sides
plus:
all diagonals
A polygon has n sides, so:
D = n(n − 1)/2 − n
Factor:
D = [n(n − 1) − 2n]/2
= n(n − 3)/2
This gives the same formula from a counting perspective.
Triangle Diagonals
For:
n = 3
we get:
D = 3(0)/2
Therefore:
D = 0
A triangle has no nonadjacent vertex pairs.
Every pair of triangle vertices is already connected by a side.
Quadrilateral Diagonals
For:
n = 4
we get:
D = 4(1)/2
Therefore:
D = 2
A quadrilateral has exactly two diagonals.
For vertices:
A, B, C, D
they are:
AC
and:
BD
Pentagon Diagonals
For:
n = 5
we obtain:
D = 5
A regular pentagon’s diagonals form the familiar five-pointed star pattern when all of them are drawn.
The diagonal count is the same for regular and irregular pentagons.
Regularity affects lengths and angles, not the number of vertex pairs.
Heptagon Diagonals
For a seven-sided polygon:
n = 7
Then:
D = 7(4)/2
Therefore:
D = 14
Each vertex has:
7 − 3 = 4
diagonals.
Counting:
7 × 4 = 28
endpoint-based diagonal selections and dividing by 2 gives:
14
unique diagonals.
Nonagon Diagonals
For:
n = 9
we get:
D = 9(6)/2
Therefore:
D = 27
Each vertex connects diagonally to:
6
other vertices.
Decagon Diagonals
For:
n = 10
the diagonal count is:
D = 10(7)/2
Therefore:
D = 35
The Perimeter of a regular decagon depends only on its ten outer sides, whereas these 35 diagonal segments lie inside the polygonal boundary and do not contribute to perimeter.
Dodecagon Diagonals
For a 12-sided polygon:
D = 12(12 − 3)/2
= 12(9)/2
Therefore:
D = 54
Each vertex has:
9
diagonals.
This example shows how quickly diagonal count grows relative to side count.
Common Polygon Diagonal Counts
Some useful values are:
3 sides → 0 diagonals
4 sides → 2 diagonals
5 sides → 5 diagonals
6 sides → 9 diagonals
7 sides → 14 diagonals
8 sides → 20 diagonals
9 sides → 27 diagonals
10 sides → 35 diagonals
The differences between successive values are:
2, 3, 4, 5, 6, 7, 8, …
because adding a new vertex creates progressively more new diagonal connections.
Find the Number of Sides From Diagonals
Suppose D is known.
Start with:
D = n(n − 3)/2
Multiply by 2:
2D = n² − 3n
Rearrange:
n² − 3n − 2D = 0
Use the quadratic formula:
n = [3 ± √(9 + 8D)]/2
A polygon requires a positive integer number of sides, so use the positive root:
n = [3 + √(9 + 8D)]/2
provided it produces a whole number of at least 3.
Example: 20 Diagonals
Suppose:
D = 20
Then:
n = [3 + √(9 + 160)]/2
= [3 + √169]/2
= (3 + 13)/2
Therefore:
n = 8
The polygon is an octagon.
Example: 35 Diagonals
Suppose:
D = 35
Then:
n = [3 + √(9 + 280)]/2
= [3 + √289]/2
= (3 + 17)/2
Therefore:
n = 10
The polygon is a decagon.
Can a Polygon Have 16 Diagonals?
Set:
D = 16
Then:
n = [3 + √(9 + 128)]/2
= [3 + √137]/2
Since:
√137
is not an integer, n is not a whole number.
Therefore no ordinary polygon has exactly:
16 diagonals
This provides a quick validity check for diagonal-count problems.
Diagonals From One Vertex
The number of diagonals from one vertex is:
d_vertex = n − 3
If one vertex has:
9 diagonals
then:
n − 3 = 9
Therefore:
n = 12
The polygon is a dodecagon.
Its total number of diagonals is:
12(9)/2 = 54
Find Total Diagonals From Per-Vertex Count
If each vertex has d diagonals:
n = d + 3
Therefore:
D = (d + 3)d/2
For:
d = 5
we obtain:
n = 8
and:
D = 8(5)/2
= 20
Diagonals and Interior-Angle Triangulation
Drawing all possible diagonals from one vertex of a convex polygon divides it into:
n − 2 triangles
Notice the two formulas are different:
diagonals from one vertex = n − 3
triangles formed = n − 2
The reason is that n − 3 interior diagonals plus two outer sides from the chosen vertex create n − 2 triangular regions.
This triangulation explains the Interior Angles formula:
S = (n − 2)180°
Pentagon Triangulation Example
A pentagon has:
5 − 3 = 2
diagonals from one chosen vertex.
Those two diagonals divide it into:
5 − 2 = 3
triangles.
Therefore its interior-angle sum is:
3(180°)
= 540°
The total number of diagonals in the whole pentagon remains:
5
Exterior Angles and Diagonal Count
For a regular polygon, each Exterior Angle is:
E = 360°/n
Therefore:
n = 360°/E
Once n is known:
D = n(n − 3)/2
This allows a regular polygon’s diagonal count to be determined from its exterior angle.
Exterior-Angle Example
Suppose each exterior angle is:
45°
Then:
n = 360°/45°
= 8
Therefore:
D = 8(5)/2
= 20
A regular octagon has:
20 diagonals
Interior Angle to Diagonal Count
For a regular polygon:
I = 180° − 360°/n
Therefore:
n = 360°/(180° − I)
If:
I = 150°
then:
n = 360°/30°
= 12
So:
D = 12(9)/2
Therefore:
D = 54
Regular Polygon Diagonal Lengths
The counting formula tells how many diagonals exist but does not determine their lengths.
In a regular polygon, diagonal lengths can be found from circle or trigonometric relationships when a circumradius or side length is known.
If two vertices lie on a circumcircle of radius R and their central separation is θ:
diagonal length = 2R sin(θ/2)
This is the same geometric relationship used for Chord Length.
Why Regular Polygon Diagonals Are Chords
A regular polygon can be inscribed in a circle.
Every side and diagonal joins two points on the circumference.
Therefore every side and diagonal is a chord.
Adjacent vertices form polygon sides.
Nonadjacent vertices form diagonals.
The difference is how many central-angle steps separate their endpoints.
Regular Pentagon Diagonal
For a regular pentagon inscribed in a circle of radius R, consecutive vertices are separated by:
360°/5 = 72°
A diagonal skips one vertex, so its central angle is:
144°
Thus its length is:
d = 2R sin72°
This is longer than a side:
s = 2R sin36°
The diagonal-to-side ratio has the familiar golden-ratio relationship.
Regular Hexagon Diagonals
A regular hexagon has several diagonal lengths.
Its side subtends:
60°
A diagonal skipping one vertex subtends:
120°
so:
d = 2R sin60°
= √3R
The longest diagonal joins opposite vertices and subtends:
180°
Therefore:
d_long = 2R
which is the circle’s diameter.
Number of Diagonals Through a Polygon Center
The total number of polygon diagonals and the number passing through the center are different questions.
For a regular polygon with even n, opposite vertices can be connected.
There are:
n/2
such opposite-vertex diagonals.
Each passes through the center.
For a regular octagon:
n/2 = 4
diameter-like diagonals pass through the center, although the octagon has:
20
diagonals in total.
Odd-Sided Regular Polygons
A regular polygon with odd n has no pair of exactly opposite vertices.
Therefore no diagonal joins two vertices through the center as a diameter would.
A regular pentagon has:
5
diagonals, but none joins opposite vertices because no opposite vertex exists.
Diagonals and Polygon Area
Diagonal count alone does not determine area.
For example, every quadrilateral has:
2 diagonals
but quadrilaterals can have arbitrarily different sizes.
A length scale is still required.
For a regular polygon, the Regular Polygon Area can be found from measurements such as:
apothem and perimeter
or:
side length and n
Diagonal information may help derive those lengths but does not replace them automatically.
Diagonals and Perimeter
Polygon perimeter uses only the outside edges.
For a regular n-gon with side length s:
P = ns
The diagonal count:
D = n(n − 3)/2
is independent of s.
A small regular octagon and a large regular octagon both have:
20 diagonals
even though their perimeters and diagonal lengths differ.
Coordinate Polygon Diagonals
If polygon vertices are specified by coordinates, a particular diagonal is the segment joining two nonadjacent vertices.
Its length can be calculated using the Distance Formula:
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
The counting formula determines how many diagonals exist.
The distance formula determines the length of an individual one.
Coordinate Quadrilateral Example
Suppose rectangle vertices are:
A = (0,0)
B = (6,0)
C = (6,8)
D = (0,8)
Its two diagonals are:
AC
and:
BD
For AC:
d = √(6² + 8²)
= 10
For BD:
d = √[(0 − 6)² + (8 − 0)²]
= 10
The rectangle has two equal diagonals.
Diagonal Equations
A diagonal also lies on a straight line through its two endpoint vertices.
The Point-Slope Form or two-point method can describe that supporting line.
For the rectangle diagonal from:
A = (0,0)
to:
C = (6,8)
slope is:
m = 8/6
= 4/3
Therefore:
y = (4/3)x
describes the line containing diagonal AC.
The finite diagonal is only the part between A and C.
Intersections of Polygon Diagonals
Some polygon diagonals cross inside the polygon.
In a quadrilateral, its two diagonals may intersect once.
In larger polygons, many different diagonal pairs can intersect.
The total number of intersection points is not generally equal to the number of diagonals because several diagonals may cross and different arrangements can create different intersection behavior.
For convex polygons in general position, more advanced counting formulas can be used, but that is a separate problem from simply finding:
D = n(n − 3)/2
Parallelogram Diagonals
A parallelogram has:
2 diagonals
like every quadrilateral.
Its special property is that those diagonals bisect each other.
If their endpoints are known in coordinates, the Midpoint Formula gives the same midpoint for both diagonals.
This common midpoint is their intersection.
Rectangle Diagonals
A rectangle’s diagonals:
bisect each other
and:
have equal lengths
For length l and width w:
d = √(l² + w²)
This is a direct Pythagorean Theorem application.
A square adds the further property that its diagonals are perpendicular.
Rhombus Diagonals
A rhombus has two diagonals that:
bisect each other
are perpendicular
They are not generally equal unless the rhombus is a square.
Their lengths can determine Rhombus Area:
A = d₁d₂/2
So diagonals can play a metric role in addition to being counted combinatorially.
Kite Diagonals
A kite also has two diagonals.
They are perpendicular, and one bisects the other.
The Kite Area formula is:
A = d₁d₂/2
Again, the number of diagonals is fixed by the quadrilateral’s four vertices, while the special kite geometry determines what those diagonals do.
Polygon Diagonals and Polar Coordinates
A regular polygon centered at the origin can be represented naturally in Polar and Rectangular Form.
For circumradius R:
r = R
for every vertex.
The vertex angles are:
θₖ = θ₀ + 2πk/n
A diagonal connects two nonadjacent values of k.
Their angular separation determines diagonal length.
Polar Diagonal Example
Suppose a regular octagon has circumradius:
R
Adjacent vertices differ by:
2π/8 = π/4
A diagonal skipping one intermediate vertex has separation:
2(π/4) = π/2
Therefore its length is:
d = 2R sin(π/4)
= √2R
Polar angular spacing makes the diagonal geometry especially clear.
Polygon Diagonals in Prism Bases
A prism can have a polygon as each base.
For example, a pentagonal prism has two pentagonal bases.
Each pentagon has:
5 diagonals
The Prism Volume depends on base area and perpendicular prism height:
V = Bh
It does not depend directly on the number of base diagonals.
However, diagonal information may help determine base dimensions in a more complex geometry problem.
Polygon Diagonals in Pyramid Bases
A pyramid can likewise have a polygonal base.
A regular octagonal pyramid has:
20
base diagonals because its base is an octagon.
The Pyramid Volume formula:
V = Bh/3
still uses base area B and perpendicular height h.
The diagonal count identifies connectivity among base vertices, not three-dimensional volume.
2D Polygon Diagonal Versus 3D Space Diagonal
A polygon diagonal is a two-dimensional segment between nonadjacent vertices of one polygon.
A three-dimensional solid can also have:
face diagonals
and:
space diagonals
These are different concepts.
For example, a rectangular prism contains rectangular face diagonals and diagonals connecting opposite vertices through the solid’s interior.
The polygon formula:
n(n − 3)/2
applies to a polygon, not to an arbitrary three-dimensional solid.
Diagonal Growth as n Increases
Expand:
D = n(n − 3)/2
to:
D = (n² − 3n)/2
The dominant term for large n is approximately:
n²/2
So diagonal count grows quadratically.
Doubling n eventually produces roughly four times as many diagonals, not merely twice as many.
Example of Growth
For:
n = 10
we have:
D = 35
For:
n = 20
we get:
D = 20(17)/2
= 170
The side count doubled, but the diagonal count increased from:
35
to:
170
because the number of possible vertex pairs grows rapidly.
Adding One New Vertex
Compare an n-gon with an (n + 1)-gon.
Their diagonal counts differ by:
D(n + 1) − D(n)
Using the formula:
D(n) = n(n − 3)/2
the increase simplifies to:
n − 1
So adding one vertex to an n-gon creates:
n − 1
additional diagonals overall.
For example, going from a hexagon to a heptagon:
14 − 9 = 5
and:
n − 1 = 6 − 1 = 5
Diagonal Count and Complete Graphs
If every pair of n vertices were connected, the total number of segments would be:
n(n − 1)/2
This includes:
n polygon sides
and:
n(n − 3)/2 diagonals
Therefore:
sides + diagonals = all vertex pairs
This graph-like viewpoint provides another consistency check.
Common Polygon Diagonal Mistakes
A frequent mistake is using:
n(n − 1)/2
as the diagonal formula.
That counts all pairs of vertices, including polygon sides.
Subtracting n sides gives:
n(n − 3)/2
Another mistake is forgetting to divide by 2 after counting diagonals from every vertex.
Each diagonal has two endpoints and would otherwise be counted twice.
Do not count a side as a diagonal.
The formula works for regular and irregular simple polygons; regularity is not required for counting.
When solving backward for n, the answer must be a positive whole number of at least 3.
Do not confuse:
diagonals from one vertex = n − 3
with:
total diagonals = n(n − 3)/2
Finally, do not apply the polygon formula directly to three-dimensional prism or pyramid space diagonals.
Frequently Asked Questions
What is a polygon diagonal?
A diagonal connects two nonadjacent vertices of a polygon.
What is the polygon diagonals formula?
D = n(n − 3)/2
How many diagonals come from one vertex?
n − 3
Why is the total divided by 2?
Because counting from every vertex counts each diagonal once from each endpoint.
How many diagonals does a triangle have?
0
How many diagonals does a quadrilateral have?
2
How many diagonals does a pentagon have?
5
How many diagonals does a hexagon have?
9
How many diagonals does an octagon have?
20
How many diagonals does a decagon have?
35
How do you find the number of sides from the diagonal count?
n = [3 + √(9 + 8D)]/2
The result must be a valid whole number.
Does a regular polygon have more diagonals than an irregular polygon with the same number of sides?
No. Diagonal count depends only on n.
Are polygon sides counted as diagonals?
No.
Can coordinates be used to find diagonal length?
Yes. Once the diagonal endpoints are known:
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
Do polygon diagonals count toward perimeter?
No. Perimeter follows the outer boundary only.
How can I check a diagonal-count answer?
Confirm that each vertex has n − 3 possible diagonals, multiply by n, divide by 2, and verify that the result also equals all vertex pairs minus the n sides.



