Polygon Diagonals Calculator
Calculate the number of diagonals in a polygon from its number of sides, plus the triangulation count and sum of interior angles. For small polygons, lists every individual diagonal as a vertex pair.
Input
A polygon needs at least 3 sides. The full diagonal list is shown for n up to 25.
Output
| Metric | Value |
|---|---|
| No data yet | |
More ways to use this tool
REST API
curl -X POST https://api.iotools.cloud/v1/tool/polygon-diagonals-calculator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sides": "6"
}'Swap in your own key from your account. The tool's fields are the body — no wrapper.
Ask an AI agent
Use the IOTools `polygon-diagonals-calculator` tool (Polygon Diagonals Calculator) on this input:
YOUR_INPUT_HEREPaste this at any agent connected to the IOTools MCP server, then add your input.
Embed widget
<iframe
src="https://iotools.cloud/embed/polygon-diagonals-calculator/"
width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
title="Polygon Diagonals Calculator — iotools.cloud"
sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
allow="clipboard-write"
style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>Drop this into your own page — free, no key required, just a link back.
| Cost per API/MCP call | From 5 credits |
|---|---|
| Need more credits? | View pricing |
Also available with
Guides
The Polygon Diagonals Calculator finds the total number of diagonals in any simple polygon from its number of sides, along with the triangulation count and the sum of interior angles. For polygons with up to 25 sides, it also lists every individual diagonal as a vertex pair, so you can see exactly which corners connect.
How to use it
- Enter the number of sides (n) of your polygon — at least 3.
- Read the results: total diagonals, diagonals per vertex, the number of triangles the polygon splits into from one vertex, and the sum of its interior angles.
- For polygons with 25 sides or fewer, scroll down to see the full list of diagonals, written as vertex pairs (e.g.
1-3) with vertices numbered 1 through n around the polygon.
The formulas
For a polygon with n sides (and n vertices):
- Total diagonals = n(n − 3) / 2
- Diagonals per vertex = n − 3 (every vertex connects to all others except itself and its two neighbors)
- Triangles from one vertex = n − 2 (the number of triangles a fan triangulation splits the polygon into)
- Sum of interior angles = (n − 2) × 180°
A triangle (n = 3) has zero diagonals — every vertex is already adjacent to every other. A square (n = 4) has 2, a pentagon (n = 5) has 5, and a hexagon (n = 6) has 9.
Worked example
For a hexagon (n = 6): total diagonals = 6(6 − 3) / 2 = 9, diagonals per vertex = 6 − 3 = 3, triangulation count = 6 − 2 = 4 triangles, and the sum of interior angles = (6 − 2) × 180° = 720°. The 9 diagonals, numbering the vertices 1 through 6, are 1-3, 1-4, 1-5, 2-4, 2-5, 2-6, 3-5, 3-6, and 4-6.
Frequently asked questions
Does this work for irregular polygons?
Yes — the diagonal count, triangulation count, and interior-angle sum depend only on the number of sides, not on whether the polygon is regular (equal sides/angles) or irregular. They do assume the polygon is simple (its edges don't cross) and convex enough that the numbered-diagonal list is meaningful for a concave shape; for a concave polygon, some "diagonals" listed may actually lie outside the polygon.
Why is the diagonal list capped at 25 sides?
The number of diagonals grows quadratically with n — a 25-sided polygon already has 275 of them. Beyond that the full list stops being useful to read, so only the counts are shown; the formulas above work for any n.
Is my data sent anywhere?
No. All calculations run locally in your browser. Your input never leaves your device.