Regular polygon calculator
Enter the number of sides and the side length of a regular polygon and get all its measures at once: a hexagon with sides of 2 has a perimeter of 12, interior angles of 120° and a circumradius of 2. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Sides
- 6
- Side length
- 2
- Perimeter
- 12
- Interior angle
- 120
- Apothem
- 1.7320508076
- Circumradius
- 2
A regular polygon has equal sides and equal interior angles. Once you fix the number of sides and the common side length, every classical metric is determined: the perimeter is simply the product of those two numbers, each interior angle follows from the regular n-gon formula, the apothem is the distance from the center to the midpoint of a side, the circumradius is the distance from the center to a vertex, and the area can be written with side length and the tangent of half the central angle. Students need these numbers for homework on hexagons, octagons, and other regular figures; makers and engineers need them when a bolt pattern, tile, or frame is specified by side count and edge length alone.
What a regular polygon is and which two inputs fix every metric
In Euclidean plane geometry a regular n-gon is equilateral and equiangular: every side has the same length and every interior angle has the same measure. Congruence is fixed once you choose n and one length scale. The perimeter is n times the side length.
The interior angle in degrees is one hundred eighty times (n minus two) divided by n, which recovers sixty degrees for an equilateral triangle, ninety for a square, one hundred twenty for a regular hexagon, and approaches one hundred eighty as n grows large. The apothem is the inradius of the figure—the perpendicular distance from the center to a side—and equals the side length divided by twice the tangent of pi over n.
The circumradius is the distance from the center to any vertex and equals the side length divided by twice the sine of pi over n. Area is one half times n times side length times apothem, which simplifies to n times side length squared over four times the tangent of pi over n. Search intent clusters around regular polygon calculator, regular polygon area perimeter, apothem calculator, and circumradius of a regular polygon.
People want numeric results they can check against a textbook answer key, a CNC cut list, or a tile layout, not only a proof that the figure is determined.
What you can do with it
Homework and exam regular-polygon drills
Students and graders confirm area, perimeter, interior angle, apothem, and circumradius for triangles through dodecagons, including rejection when the side count is below three.
FAQ
Which formulas does the calculator use?
Perimeter is n·s. Interior angle is ((n−2)/n)·180°. Apothem is s/(2·tan(π/n)). Circumradius is s/(2·sin(π/n)). Area is (n·s²)/(4·tan(π/n)).
What happens if sides is below 3?
A regular polygon requires at least three sides; digons and monogons are rejected and those calls are not charged.
Is the regular polygon calculator free?
The browser tool runs free on your device.
What is the difference between apothem and circumradius?
The apothem is the distance from the center to the midpoint of a side (inradius). The circumradius is the distance from the center to a vertex. For the same n and s, the circumradius is always larger than the apothem.
What is the area of a regular hexagon with sides of 2?
About 10.3923048454. The same calculation gives a perimeter of 12, an apothem of about 1.7320508076 and a circumradius of 2, so you can check every measure of the figure in one go.
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/regular-polygon \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"sides":6,"side_length":2}'const res = await fetch("https://api.kit.forhosting.com/geom/regular-polygon", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"sides": 6,
"side_length": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/regular-polygon",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"sides": 6,
"side_length": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/regular-polygon", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"sides":6,"side_length":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"sides":6,"side_length":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/regular-polygon", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"sides": 6,
"side_length": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.regular_polygon",
"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 capacity accepts integer sides of three or more and a positive side length, rejects digons and monogons, and returns perimeter, interior angle, apothem, circumradius, and area as structured JSON.
What a regular polygon is and which two inputs fix every metric
Delivering sides, side_length, perimeter, interior_angle, apothem, circumradius, and area as JSON makes the result easy to paste into notes, diff in automated tests, or feed into a larger pipeline without reimplementing trigonometric formulas in every language you teach or deploy.
How this calculator validates input and applies the closed-form formulas
After validation the engine sets the central half-angle to pi divided by n, computes the sine and tangent of that angle, then evaluates perimeter as n times s, interior angle as ((n minus two) over n) times one hundred eighty degrees, apothem as s over two times tan of pi over n, circumradius as s over two times sin of pi over n, and area as n times s squared over four times tan of pi over n. Edge cases are explicit: sides equal to two or one, zero or negative side lengths, non-numeric strings, missing fields, and non-integer side counts all fail before any metric is returned. Send a JSON body with sides and side_length. sides must be an integer at least three; values below three fail with invalid_input because a regular polygon with fewer than three sides is not a non-degenerate Euclidean figure under this contract. side_length must be a positive finite number. Results are rounded to a stable decimal precision so the same input always yields the same JSON across JavaScript engines. You may use any length unit for side_length; perimeter, apothem, circumradius, and area are expressed in that same unit system so a side of two meters produces an area in square meters without unit conversion inside the engine.
Practical use, limits, pricing, and delivery channels
Use the browser tool when you want an immediate regular-polygon solution while checking homework, sizing a hexagonal tile, verifying a bolt circle derived from a side length, or confirming a workshop drawing without installing a computer-algebra system. Results are fully deterministic: the same sides and side length always yield the same perimeter, interior angle, apothem, circumradius, and area fields. There is no language model, no external geometry service, and no randomness, so the capacity is safe to pin in continuous-integration checks and reproducible lesson materials. Each successful request is one billable item at $0.002; failed validation does not consume balance. Accepted inputs must satisfy sides greater than or equal to three and a strictly positive side length; digons, monogons, and non-positive edges are rejected with a clear invalid_input message. Wire the endpoint into polygon drills, contest answer checkers, manufacturing worksheets that list only n and s, or floating preprocessing steps where you already prefer explicit domain errors over opaque black-box widgets that cannot show why sides below three are rejected.
Integration use cases
Deterministic fixtures for geometry tests
Pipelines that seed unit tests or interactive polygon demos can call a pure regular-polygon oracle instead of reimplementing sine, tangent, and degree conversion in every language.
Tile, bolt, and frame layouts from n and edge length
Shop or design notes that specify a regular n-gon by side count and side length recover full metrics as structured JSON for reports, cut lists, or lightweight CAD helpers.
Technical questions
How do I compute regular polygon metrics with this API?
Send a JSON body with sides (integer ≥ 3) and side_length (positive number) to geom.regular_polygon. The response returns perimeter, interior_angle, apothem, circumradius, and area.