# Number of Diagonals in a Polygon Calculator

Any plane shape that is formed by the straight lines closed in a loop is called as the polygon. Diagonal is a straight line joining two vertices of polygon. Use the below calculator to find out the total number of diagonals in a polygon, using the formula given below without drawing the shape and counting the diagonals.
The formula is n(n - 3)/2, where n is your number of sides.

Any plane shape that is formed by the straight lines closed in a loop is called as the polygon. Diagonal is a straight line joining two vertices of polygon. Use the below calculator to find out the total number of diagonals in a polygon, using the formula given below without drawing the shape and counting the diagonals.
The formula is n(n - 3)/2, where n is your number of sides.

Code to add this calci to your website

#### Formula:

s = n * (n - 3) / 2
**Where,**
s = No. of Diagonals
n = No. of Sides

#### Example

**For a polygon with 8 sides, the number of diagonals is **

= 8 (8-3) / 2

= 4 x 5

= 20