Home › Geometry › Regular Polygon Calculator
Regular Polygon Calculator
Computes the area, perimeter, interior and exterior angles in degrees, apothem, circumradius and number of diagonals of a regular polygon from its number of sides and side length.
When to use
You need properties of an equilateral, equiangular polygon (pentagon, hexagon, octagon, …) with 3 to 100 sides.
Do not use when: The polygon is irregular (split it into triangles and use triangle-area) or is a square, for which rectangle also works.
Formula
With n = number_of_sides and s = side_length: area = n·s² / (4·tan(π/n)); perimeter = n·s; interior angle = (n − 2)·180°/n; exterior angle = 360°/n; apothem = s / (2·tan(π/n)); circumradius = s / (2·sin(π/n)); diagonals = n·(n − 3)/2
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
number_of_sides | integer | yes | Number of sides n (3 = equilateral triangle, 4 = square, 6 = hexagon, …). Range: ≥ 3, ≤ 100 | |
side_length | number | units | yes | Length of each side. Range: > 0 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
polygon_name | string | Common name of the polygon (e.g. hexagon), or n-gon. | |
area | number | units² | n × s² / (4 × tan(180° / n)). |
perimeter | number | units | n × s. |
interior_angle_deg | number | degrees | (n − 2) × 180° / n. |
exterior_angle_deg | number | degrees | 360° / n. |
interior_angle_sum_deg | number | degrees | (n − 2) × 180°. |
apothem | number | units | Distance from the centre to the middle of a side = s / (2 × tan(180° / n)). |
circumradius | number | units | Distance from the centre to a vertex = s / (2 × sin(180° / n)). |
diagonals | integer | n × (n − 3) / 2. |
Example
Hexagon, side 2: {"number_of_sides":6,"side_length":2} → {"polygon_name":"hexagon","area":10.3923,"perimeter":12,"interior_angle_deg":120,"exterior_angle_deg":60,"interior_angle_sum_deg":720,"apothem":1.7321,"circumradius":2,"diagonals":9}
Pentagon, side 10: {"number_of_sides":5,"side_length":10} → {"polygon_name":"pentagon","area":172.0477,"perimeter":50,"interior_angle_deg":108,"exterior_angle_deg":72,"apothem":6.8819,"circumradius":8.5065,"diagonals":5}
GET https://tttkmbb.com/api/v1/calculate/regular-polygon?number_of_sides=6&side_length=2
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/regular-polygon(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/regular-polygon · Markdown: https://tttkmbb.com/geometry/regular-polygon.md · JSON definition: https://tttkmbb.com/geometry/regular-polygon.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="regular-polygon" - OpenAPI operationId:
calculate_regular_polygon_properties - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Regular polygon (reference)
- Wolfram MathWorld – Regular Polygon (reference)
FAQ
What is the apothem?
The perpendicular distance from the centre to a side, equal to the radius of the inscribed circle. Area also equals perimeter × apothem / 2.
Can I start from the circumradius instead of the side?
Convert first: side = 2 × R × sin(180° / n), then enter that side length.
Related calculators
- Circle Calculator — Limit of a regular polygon as the number of sides grows; the circumscribed circle.
- Triangle Area Calculator — Area of a general (irregular) triangle.
- Angle Converter — Convert the angles to radians.