A regular polygon has equal sides and equal angles, which means a small set of formulas describes every shape from an equilateral triangle to a regular hectagon and beyond. This calculator accepts any one known measurement — side length, perimeter, circumradius or inradius — and returns every other property including the area, with an SVG diagram and the full working so you can follow every step.
How it works
Given n sides of length s, all properties follow from one set of identities rooted in the fact that the polygon can be divided into n congruent isosceles triangles, each with two sides equal to the circumradius R and a base of length s.
The central formulas are:
Area (A) = (n * s^2) / (4 * tan(PI / n))
Perimeter (P) = n * s
Inradius / apothem (r) = s / (2 * tan(PI / n))
Circumradius (R) = s / (2 * sin(PI / n))
Interior angle = (n - 2) * 180 / n [degrees]
Exterior angle = 360 / n [degrees]
Solve for variable: if you supply R instead of s, the tool inverts
R = s / (2 * sin(PI/n)) to get s = 2 * R * sin(PI/n).
If you supply the inradius r, it inverts r = s / (2 * tan(PI/n)) to get
s = 2 * r * tan(PI/n).
If you supply the perimeter P, it uses s = P / n.
In every case the back-solved side length feeds into all other formulas.
Area from the apothem (alternative view): slicing the polygon into n triangles from
the centre, each with base s and height r, gives
A = n * (1/2 * s * r) = (1/2) * P * r.
Both forms yield identical results; the calculator uses the tangent form internally.
Worked example
A regular octagon (n = 8) with side length 7:
- Perimeter = 8 x 7 = 56
- Interior angle = (8 - 2) x 180 / 8 = 135 degrees
- Exterior angle = 360 / 8 = 45 degrees
- Inradius = 7 / (2 x tan(22.5 degrees)) = 7 / (2 x 0.41421) approx 8.4497
- Circumradius = 7 / (2 x sin(22.5 degrees)) = 7 / (2 x 0.38268) approx 9.1459
- Area = (8 x 49) / (4 x tan(22.5 degrees)) approx 236.59
Equivalently: Area = (1/2) x 56 x 8.4497 approx 236.59. Both routes agree.
| Sides (n) | Name | Interior angle | Area (s = 10) |
|---|---|---|---|
| 3 | Equilateral triangle | 60 deg | 43.30 |
| 4 | Square | 90 deg | 100.00 |
| 5 | Pentagon | 108 deg | 172.05 |
| 6 | Hexagon | 120 deg | 259.81 |
| 8 | Octagon | 135 deg | 482.84 |
| 12 | Dodecagon | 150 deg | 1119.62 |
Formula note
The tangent form A = (n * s^2) / (4 * tan(PI/n)) follows directly from summing the n
centre triangles: each has area (1/2) * s * r where r = s / (2 * tan(PI/n)), so
n * (1/2) * s * s / (2 * tan(PI/n)) = (n * s^2) / (4 * tan(PI/n)).
As n grows large the polygon approaches a circle; at n = 1000 with s = 1 the area
is approximately PI * R^2, confirming the formula degrades gracefully to the circle formula.
The circumradius form R = s / (2 * sin(PI/n)) derives from the law of sines applied to
each of the n centre triangles, each subtending an angle of 2 * PI / n at the centre.
All calculations run locally in your browser — nothing is sent to any server.