Sum of interior angles calculator
Enter the number of sides and get the total of all interior angles of any simple polygon: a pentagon adds up to 540°, regular or not, because it splits into three triangles. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 5
- Interior angle sum deg
- 540
The sum of the interior angles of a polygon is one of the first reliable facts geometry students learn and one of the last checks designers, CAD scripts, and game tools still need when a shape is defined only by how many sides it has. For any simple closed polygon with n sides, that total is always (n minus two) times one hundred eighty degrees, whether the polygon is regular or irregular, equilateral or stretched. No tables of special cases, no confusion with exterior turns or per-vertex measures, and the same pure logic runs free in your browser before you wire the paid automation path for homework checkers, layout validators, or procedural pipelines that only need the global sum.
Why the interior angle sum depends only on the number of sides
Pick any simple polygon in the plane—triangle, quadrilateral, pentagon, irregular house outline, or a convex n-gon from a mesh generator—and count its sides. That single integer n already fixes the sum of every interior corner around the boundary. The classical proof triangulates the polygon: from one vertex you draw non-crossing diagonals that split the shape into exactly n minus two triangles.
Each triangle contributes one hundred eighty degrees, so the interior angle sum is always (n minus two) times one hundred eighty degrees. A triangle (n equals three) sums to one hundred eighty degrees; a quadrilateral to three hundred sixty; a pentagon to five hundred forty; a hexagon to seven hundred twenty; and so on without exception for simple polygons. Regularity is irrelevant for this total: a wildly skewed quadrilateral still sums to three hundred sixty degrees even when no single angle is a right angle.
Concave simple polygons obey the same sum as long as the interior is defined on one side of each edge; self-intersecting star polygons are outside this contract because their winding is not a simple closed chain. Classroom worksheets, textbook answer keys, and many drafting notes phrase the question as “find the sum of the interior angles of an n-gon,” and this capability answers that question with one field and one number.
Who needs the interior angle total
Classrooms and tutoring platforms use a sum of interior angles calculator so learners can check homework for heptagons, dodecagons, and irregular n-gons without memorizing a long table. Exam generators need a deterministic oracle that rejects n less than three instead of inventing a total for digons or line segments that are not polygons. Architecture and CAD scripts often know only the side count of a regular or irregular floor plan cell and must confirm that the design’s corner totals match (n minus two) times one hundred eighty before locking constraints.
Game and graphics pipelines that build UI badges, radar charts, or procedural props sometimes store only n and need the global interior sum for documentation, accessibility labels, or validation before they walk the boundary with exterior turns. Failed validation does not consume balance.
What you can do with it
Classroom and homework checks
Let students submit n for any simple polygon and verify that the interior angle sum matches (n−2)×180° against textbook tables.
Exam and LMS auto-grading
Mark “find the sum of the interior angles” items with a deterministic oracle that rejects n below three without inventing a total.
CAD and procedural validation
Confirm that a design or mesh cell with known side count uses the expected global interior sum before baking geometry.
FAQ
How do I calculate the sum of interior angles of a polygon?
Send integer n (number of sides, n ≥ 3). The sum in degrees is always (n − 2) × 180.
What happens if n is fewer than three sides?
A polygon needs at least three sides, so n less than three is rejected without charge.
Does the formula work for irregular polygons?
Yes. The interior angle sum (n−2)×180° holds for any simple n-gon, regular or irregular. Only the side count n is required.
Are results in degrees or radians?
The sum is returned in degrees. Convert to radians client-side if your pipeline expects radians.
Does the formula work for concave or star-shaped polygons?
It works for concave polygons whose edges do not cross, such as an irregular house outline. Self-intersecting star polygons are outside this calculation, because their boundary is not a simple closed chain.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geom/polygon-sum-interior-angles \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":5}'const res = await fetch("https://api.kit.forhosting.com/geom/polygon-sum-interior-angles", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"n": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/polygon-sum-interior-angles",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"n": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/polygon-sum-interior-angles", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"n":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"n":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/polygon-sum-interior-angles", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"n": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.polygon_sum_interior_angles",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
This sum of interior angles calculator turns that single identity into a deterministic API and a free browser tool: send an integer n of three or more and receive the total interior angle sum in degrees plus a short formula string that restates the arithmetic.
Why the interior angle sum depends only on the number of sides
This endpoint therefore asks only for n and returns only the total sum in degrees. It does not compute each individual interior angle, does not assume equal sides, and does not report exterior angles. That narrow focus matches the search intent behind a sum of interior angles calculator: people who already know they need the global total, not a full regular-polygon angle suite.
Input contract, formula, and error behaviour
The interior sum is exactly (n minus two) times one hundred eighty and is always an integer when n is an integer, so no floating-point rounding is applied to the sum itself. Example: n equals eight yields one thousand eighty degrees. Angles are reported in degrees only—the unit almost every school exercise and drafting note expects. Convert to radians client-side by multiplying by pi over one hundred eighty if your graphics pipeline speaks radians. Pair the response with your own drawing code when you must place vertices; the capability computes the angle sum only and does not emit coordinates, side lengths, or area. POST a JSON body with a single required field n: an integer greater than or equal to three and at most one million. Values below three fail with invalid_input because a polygon needs at least three sides; non-integers, missing fields, empty strings, and n above the published maximum also fail with invalid_input and are not billed. On success the body contains n, interior_angle_sum_deg, and a formula string that expands (n minus two) times one hundred eighty into the concrete product for that n. Example: n equals five yields interior_angle_sum_deg five hundred forty and a formula restating (5−2)×180 = 540. If you later need each interior angle of a regular n-gon, divide the sum by n on the client; this API deliberately does not emit per-angle fields so that clients and SEO landings that only care about the total stay aligned with the response shape.
Where a sum-of-interior-angles API earns its keep
Bound n, keep the request to one integer, and you get a reproducible degree total you can pin in tests, notebooks, LMS plugins, and edge workers without standing up a geometry library of your own.
Technical questions
What does the sum of interior angles calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.