Polygon Diagonals CalculatorFree online math calculator — instant results, no sign-up
Count the diagonals of a polygon.
Sign in to save results and favorites.
About the Polygon Diagonals Calculator
The Polygon Diagonals Calculator counts the line segments joining nonadjacent vertices of a polygon from its number of sides. With the default input of 8 sides, it returns 20 diagonals. You do not need side lengths or angle measurements.
- Number of sides
- The number of sides in the polygon, entered as a unitless whole-number count of at least 3.
Formula and method
D = n(n − 3) / 2; with n = 8, D = 8(8 − 3) / 2 = 20.
- DThe total number of distinct diagonals in the polygon.
- nThe number of sides, which equals the number of vertices.
Each vertex can connect diagonally to n − 3 vertices: exclude the vertex itself and its two adjacent vertices. Multiplying by n counts every diagonal twice, once from each endpoint, so divide by 2 to obtain the distinct diagonal count.
Worked example
These are the calculator's starting values and the results it actually produces for them.
Inputs
- Number of sides8
Results
- Result20
How to use the Polygon Diagonals Calculator
- 1Identify the polygon's number of sides.
- 2Enter that count in Number of sides; keep the default value of 8 for the worked example.
- 3Confirm that the input is a whole number of at least 3.
- 4Calculate the count using D = n(n − 3) / 2: 8 × 5 / 2 = 20.
- 5Read Result as the total number of distinct diagonals.
Reading your result
The Result row gives a unitless count of distinct diagonals, not their combined length or the number of intersections between them. For Number of sides = 8, Result = 20 means the polygon has 20 segments connecting pairs of nonadjacent vertices.
Limitations
The formula assumes an ordinary simple polygon with distinct vertices and a whole-number side count of at least 3. It applies to both regular and irregular polygons, including concave polygons; in a concave polygon, some diagonals may lie partly or entirely outside the polygon. It does not determine diagonal lengths, intersection counts, or which diagonals lie inside the boundary. Self-intersecting or degenerate shapes may require additional definitions.
Common questions
Why does a polygon with 8 sides have 20 diagonals?+
Each of its 8 vertices connects diagonally to 5 nonadjacent vertices. The product 8 × 5 counts each diagonal from both ends, so dividing by 2 gives 20.
Does the polygon need to have equal sides and angles?+
No. The diagonal count depends only on the number of vertices and their adjacency, so regular and irregular simple polygons with the same side count have the same number of diagonals.
Are polygon sides included in the result?+
No. Sides join adjacent vertices, whereas diagonals join nonadjacent vertices. The formula excludes the two neighboring vertices at every vertex.
Does a crossing between diagonals create additional diagonals?+
No. Each diagonal is counted once by its pair of original polygon vertices. Crossing points do not add vertices or diagonals to this calculation.
Does the calculator save my information?+
Calculations run in your browser. While signed in, inputs and results are automatically recorded in account history; saving a result creates a separate saved record.
You might also like
Slope Calculator
Slope, angle and line equation through two points.
Area Calculator
Area of common 2D shapes.
Volume Calculator
Volume of common 3D shapes.
Surface Area Calculator
Surface area of 3D shapes.
Circle Calculator
Radius, diameter, circumference and area.
Triangle Calculator
Solve a triangle from three sides.
Results are estimates for informational purposes and are not financial, medical or legal advice.