Number of sides from interior angle calculator
Enter one interior angle of a regular polygon and get its number of sides: 108° gives 5 sides, a pentagon, with an exterior angle of 72°. The angle has to stay below 180°. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Interior angle
- 108
- Sides
- 5
- Exterior angle
- 72
A regular polygon has equal sides and equal interior angles, so a single interior angle completely determines the shape’s side count. Students checking homework, CAD scripts validating floor plans, and game tools generating UI badges all face the same inverse problem: you already know the turn at each vertex and need n. This number of sides from interior angle calculator inverts the classic school formula. Send one interior angle in degrees—strictly below one hundred eighty—and receive the integer side count, the matching exterior angle, and a short formula string.
From interior angle back to side count
For any regular n-gon the interior angle equals one hundred eighty degrees minus three hundred sixty over n, which is the same identity as the familiar ((n minus two) times one hundred eighty) divided by n. Rearranging for the unknown side count gives n equals three hundred sixty divided by (one hundred eighty minus the interior angle).
That exterior-complement form is stable and easy to check: the exterior angle is the turn you make walking the boundary, exterior angles always sum to three hundred sixty degrees, and each exterior for a regular n-gon is three hundred sixty over n. A square has interior ninety, exterior ninety, and four sides. A regular pentagon has interior one hundred eight, exterior seventy two, and five sides.
A regular hexagon has interior one hundred twenty, exterior sixty, and six sides. As n grows, the interior angle approaches one hundred eighty from below but never reaches it for a finite convex polygon, which is why this capability insists that the input angle is strictly less than one hundred eighty degrees.
Where recovering n from an angle earns its keep
Classrooms use a number of sides from interior angle calculator so learners can reverse textbook problems that state “each interior angle is one hundred eight degrees—how many sides?” without memorizing a long table of special polygons. Architecture and product design scripts often know the meeting angle of a regular tile or bay window from a drawing note and need n to place vertices or order materials.
Procedural graphics and UI generators may start from a design token that encodes the interior turn and must resolve how many edges the badge or radar chart should draw. Keep inputs in degrees, require a true regular polygon, and the side count is a single deterministic division away.
What you can do with it
Homework inverse polygon problems
Students enter a known interior angle such as 108° or 135° and receive the integer side count to check textbook exercises that ask for n rather than for degrees.
CAD tile and layout recovery
When a drawing note lists only the interior meeting angle of a regular bay or tile, recover n before generating vertex rings or cutting lists.
Procedural UI and game shapes
Design tokens that store an interior turn can resolve how many edges a regular badge, radar chart, or prop mesh should use without hard-coding polygon tables.
FAQ
What happens if the angle is 180° or more?
Regular convex polygons have interior angles strictly below 180°, so angles that are not below 180 degrees are rejected without charge.
Does every angle below 180° work?
No. The angle must produce an integer side count n ≥ 3.
What is the formula for the number of sides from the interior angle?
Subtract the interior angle from 180 to get the exterior angle, then divide 360 by that result. For 108°, the exterior angle is 72° and 360 divided by 72 gives 5 sides.
Which regular polygon has interior angles of 135°?
An octagon. Its exterior angle is 180 minus 135, and dividing 360 by that turn gives 8 sides, so each corner of a regular octagon measures 135°.
Does the calculator also give the exterior angle?
Yes. Along with the number of sides it shows the exterior angle, which is 360 divided by the sides: 72° for a pentagon. The exterior angles of any polygon add up to 360°.
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-sides-from-interior-angle \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"interior_angle":108}'const res = await fetch("https://api.kit.forhosting.com/geom/polygon-sides-from-interior-angle", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"interior_angle": 108
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/polygon-sides-from-interior-angle",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"interior_angle": 108
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/polygon-sides-from-interior-angle", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"interior_angle":108}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"interior_angle":108}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/polygon-sides-from-interior-angle", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"interior_angle": 108
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.polygon_sides_from_interior_angle",
"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
From interior angle back to side count
Angles of one hundred eighty or more do not describe a regular convex n-gon and are rejected with invalid_input so automation fails fast instead of inventing a non-integer or infinite side count.
Input contract, validation, and response fields
The capability assumes a convex regular polygon in the plane and works only in degrees; convert from radians client-side if your pipeline stores turns as fractions of pi. POST a JSON body with the required field interior_angle: a finite number of degrees strictly below one hundred eighty. Aliases angle, angle_deg, and interior_angle_deg are accepted for the same value. On success the body includes interior_angle (echoed with stable twelve-decimal rounding), sides (the integer n), exterior_angle (three hundred sixty over n, also stably rounded), and formula (a short string restating n equals three hundred sixty over one hundred eighty minus interior). Failed validation returns invalid_input and is not billed. Bound the request to a single scalar angle and you get a reproducible integer you can pin in tests, notebooks, and edge workers without a geometry library.
Where recovering n from an angle earns its keep
Pair this endpoint with a forward angle calculator when you already know n and need degrees, or use it alone when the angle is the only measurement you have.
Technical questions
How do I find the number of sides from an interior angle?
For a regular polygon, n = 360 / (180 − interior_angle). Send the interior angle in degrees to this API; the response includes the integer sides field and the matching exterior angle.
Are angles in degrees or radians?
Degrees only. Convert from radians on the client if needed by multiplying by 180/π before calling the API.
What does the number of sides from interior angle calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.