Polygon Diagonals Calculator screenshot

Polygon Diagonals Calculator

Count the diagonals of an n-gon and give its interior and exterior angle sums.

Privacy First
0 Runs
Updated 2026-11-22
Runs in your browser
No sign-up, no upload
Exact where arithmetic allows

Polygon Diagonals Calculator

Count the diagonals of an n-gon and give its interior and exterior angle sums.

What the page prints, and what it refuses

Every figure is printed with the rule or formula that produced it, and any numerical tolerance is stated on the result rather than implied. The page refuses an input the formula does not define and names the value it read; it prints no answer it cannot support.

The calculation runs entirely in this browser tab; nothing is uploaded.

The page counts the diagonals of a polygon and gives its angle sums. An octagon has 20 diagonals, an interior angle sum of 1080°, and each interior angle of a regular octagon is 135°.

The count is n(n − 3)/2: every vertex connects to n − 3 others that are not itself or its two neighbours, and each diagonal is counted from both ends. The page prints the formula so the division by two is not a mystery.

Why n − 3 and why divide by two

From one vertex, the two adjacent vertices and the vertex itself do not form diagonals, leaving n − 3. Multiplying by n counts every diagonal twice, once from each end, so the total is n(n − 3)/2.

The interior angle sum is (n − 2) × 180°, from triangulating the polygon into n − 2 triangles. The regular polygon's per-angle values divide those sums by n.

How to use Polygon Diagonals Calculator

Enter the number of sides, at least 3, then press Run.

The result prints the diagonal count, the interior angle sum and, for a regular polygon, each interior and exterior angle.

What to Expect

Best for

  • Counting a polygon's diagonals
  • Checking an angle-sum exercise
  • Comparing regular polygons

Not ideal for

  • The diagonal lengths, which need coordinates
  • A self-intersecting polygon, where the count still holds but the picture differs
  • A polygon with fewer than three sides

What this tool keeps

  • n exactly as entered

What may need cleanup

  • Nothing: the counts are exact integers

Common errors

  • Fewer than three sides is refused
  • n above 1000 is refused with the limit named

Example use cases

  • Count an octagon's diagonals
  • Check a hexagon's angle sum
  • Compare a triangle with a quadrilateral

Sample input

n = 8

Sample output

20 diagonals, interior sum 1080°, each interior angle 135°

Who this is for

  • Geometry students
  • Readers checking a polygon fact

Frequently asked questions

Why does a triangle have no diagonals?

Every pair of vertices is already an edge, so n − 3 is zero. The formula gives 0, and the page accepts n = 3 rather than refusing it.

Is the interior angle sum the same for every octagon?

Yes, for every simple octagon. The individual angles vary, but their sum is fixed at (n − 2) × 180°.

What is an exterior angle here?

The angle between one side and the extension of the next, which for a regular polygon is 360°/n. The page prints it only as the regular value.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.