Math
Polygon calculator
For a regular polygon, give the number of sides and any one measurement to get every other one, with the angles and the number of diagonals. For an irregular polygon, list its corner coordinates and the shoelace formula gives the area, drawn to scale.
| Unit | Area |
|---|---|
| Millimetres squared (mm²) | 4156.92 |
| Centimetres squared (cm²) | 41.5692 |
| Metres squared (m²) | 0.00415692 |
| Kilometres squared (km²) | 4.15692e-9 |
| Hectares (ha) | 4.15692e-7 |
| Inches squared (in²) | 6.44324 |
| Feet squared (ft²) | 0.0447447 |
| Yards squared (yd²) | 0.00497164 |
| Miles squared (mi²) | 1.60500e-9 |
| Acres | 1.02720e-6 |
Show the working, step by step
The side is given.
s = 4
Apothem and circumradius from the side.
a = s ÷ (2 tan 30°) = 3.4641 R = s ÷ (2 sin 30°) = 4
Area is half the perimeter times the apothem.
A = ½ × 24 × 3.4641 = 41.5692
Angles. The interior angles of any n-gon add up to (n − 2) × 180°; in a regular one they are equal.
sum = (6 − 2) × 180° = 720° interior = 720° ÷ 6 = 120° exterior = 360° ÷ 6 = 60°
Diagonals: each vertex joins to n − 3 others, and each diagonal is counted from both ends.
n(n − 3) ÷ 2 = 6 × 3 ÷ 2 = 9
Regular polygon formulas
A regular polygon has n equal sides of length s and n equal angles. Joining the centre to every corner cuts it into n identical isosceles triangles, each with apex angle 360°/n, and every formula follows from one of those triangles.
R = s ÷ (2 sin(180°/n)) a = s ÷ (2 tan(180°/n)) P = ns A = ½Pa = ns² ÷ (4 tan(180°/n))
interior angle = (n − 2) × 180° ÷ n exterior angle = 360° ÷ n angle sum = (n − 2) × 180° diagonals = n(n − 3) ÷ 2
A worked example
The calculator opens on a regular hexagon with 4 cm sides.
- 180°/6 = 30°. Apothem a = 4 ÷ (2 tan 30°) = 3.46410 cm; circumradius R = 4 ÷ (2 sin 30°) = 4 cm. A hexagon's circumradius always equals its side, because it is made of six equilateral triangles.
- Perimeter 6 × 4 = 24 cm; area ½ × 24 × 3.46410 = 41.5692 cm².
- Interior angles (6 − 2) × 180° = 720° in total, 120° each; exterior angle 60°.
- Diagonals 6 × 3 ÷ 2 = 9.
Common regular polygons
| n | Name | Interior angle | Angle sum | Diagonals | Area with side 1 |
|---|---|---|---|---|---|
| 3 | Equilateral triangle | 60° | 180° | 0 | 0.433013 |
| 4 | Square | 90° | 360° | 2 | 1 |
| 5 | Pentagon | 108° | 540° | 5 | 1.72048 |
| 6 | Hexagon | 120° | 720° | 9 | 2.59808 |
| 8 | Octagon | 135° | 1,080° | 20 | 4.82843 |
| 10 | Decagon | 144° | 1,440° | 35 | 7.69421 |
| 12 | Dodecagon | 150° | 1,800° | 54 | 11.1962 |
For side length s, multiply the last column by s². As n grows, a regular polygon with a fixed circumradius approaches the circle: its area tends to πR², which is how Archimedes bounded π using polygons of 96 sides.
Area from coordinates: the shoelace formula
A = ½ |Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)|, with the last vertex joined back to the first
Choose “Irregular, from vertex coordinates” and enter the corners in order. The default pentagon has corners (0, 0), (6, 0), (7, 4), (3, 7) and (−1, 4). The five cross-products are 0, 24, 37, 19 and 0, which sum to 80, so the area is 80 ÷ 2 = 40 square units. The sum is positive, which means the corners were listed anticlockwise. The same method measures a plot of land from surveyed corner points or a floor plan from its coordinates, and it works for concave shapes such as an L-shaped room as long as the edges do not cross.
Common mistakes
- Mixing up the apothem and the circumradius. The area formula ½Pa needs the apothem, the shorter one.
- Using the interior-angle formula for the angle sum. (n − 2) × 180° is the total; divide by n for one angle of a regular polygon.
- Entering vertices out of order in the shoelace method, which makes the edges cross.
- Assuming a shape is regular because its sides are equal. A rhombus has four equal sides but is not a regular polygon unless its angles are equal too.
Common questions
What is the sum of the interior angles of a polygon?
(n − 2) × 180° for any simple polygon with n sides, regular or not. Pick one corner and draw diagonals to every other corner: they cut the polygon into n − 2 triangles, each with 180°. A pentagon has 540°, a hexagon 720°, a decagon 1,440°. In a regular polygon every angle is the same, so each interior angle is (n − 2) × 180° ÷ n: 120° for a hexagon.
What is the difference between the apothem and the circumradius?
The circumradius R runs from the centre to a corner; the apothem a runs from the centre to the middle of a side, meeting it at a right angle. The apothem is the radius of the inscribed circle, the circumradius that of the circle through the corners. For a hexagon with 4 cm sides, R = 4 cm and a = 3.46410 cm. They are linked by a = R cos(180°/n).
How many diagonals does a polygon have?
n(n − 3) ÷ 2. Each of the n corners connects to every other corner except itself and its two neighbours, which gives n − 3 diagonals per corner; dividing by 2 stops each diagonal being counted from both ends. A hexagon has 6 × 3 ÷ 2 = 9 diagonals, and a 12-sided dodecagon has 54.
How does the shoelace formula work?
Write the vertices in order round the edge, then for each edge compute xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ. That number is twice the signed area of the triangle formed by the edge and the origin. Adding them round the whole polygon cancels the parts outside and leaves twice the polygon's area. Halve it and drop the sign. The name comes from the criss-cross pattern the products make when the coordinates are written in two columns.
Why is the shoelace result wrong for my shape?
Almost always because the vertices are not in order round the boundary. If you jump across the shape, two edges cross, the polygon becomes a bow tie, and the formula subtracts one part from the other. The calculator warns when edges cross. The points can run clockwise or anticlockwise; that only changes the sign, which is removed.
Related calculators
-
Area calculator
Area of thirteen shapes, regular polygons included.
-
Triangle calculator
The three-sided polygon, from any three parts.
-
Circle calculator
The limit of a regular polygon as n grows.
-
Distance and midpoint
Edge lengths between coordinate points.