100% on-device · nothing uploaded

Regular polygon calculator

Say how many sides — or type an angle and let it work that out — then give any one length, and the whole polygon follows: every angle, the apothem, the circumradius, the perimeter, the area and each distinct diagonal, drawn to scale as you type.

How to use it

  1. Set the number of sides with the stepper, or tap one of the named shapes. Typing an interior angle, an exterior angle, an angle sum or a count of diagonals works out the number of sides for you.
  2. Type any one length onto the figure — a side, the apothem, the circumradius — or a perimeter or an area into the table below it. That is all the size information a regular polygon needs.
  3. Switch on the exterior angle, the diagonals, the n triangles or either circle to see where each formula comes from.
  4. Type a second length and the older one is released, with an undo button. How many sides is never released by a length: it is which polygon this is, not a measurement of it.

Two numbers, and only two

A regular polygon has every side the same length and every angle the same size, and that leaves it exactly two degrees of freedom: how many sides it has, and how big it is. Everything else — the interior angle, the apothem, the area, the number of diagonals — is a consequence of those two, which is why this tool asks for two values and then stops. It also explains a division that runs through the whole page. Angles and counts say nothing about size and everything about the number of sides: an interior angle of 108° is a pentagon whether it is drawn on a stamp or painted across a car park. Lengths and areas say nothing about which polygon it is: a side of 10 fits a square, a decagon, and everything between.

So a single length can never be enough on its own, and the tool says which half of the problem is still missing rather than picking a shape for you. Two lengths, though, are enough — because their ratio carries no size at all. A side of 10 with an area of 100 can only be a square; the same side with an area of 173.2 is not any regular polygon, and the answer names the pentagon and the hexagon it falls between.

The apothem, and why the area formula is just triangles

Join the centre to every corner and the polygon falls into n identical triangles, each with a side as its base and the apothem as its height. That is the whole of the area formula: n triangles of ½ × side × apothem is ½ × perimeter × apothem, and it is why the apothem — the perpendicular distance from the centre to the middle of a side — matters more here than it ever does for a triangle. Switch on "The n triangles" and the figure is the proof. The apothem is also the radius of the circle that touches every side, while the circumradius is the radius of the circle through every corner, and the gap between the two is exactly what makes a polygon a polygon rather than a circle.

Those two radii are also the two ways a hexagon gets measured in the workshop. Across flats is twice the apothem; across corners is the longest diagonal. Spanners and bolt heads are sized across the flats, so a nut described as 17 mm measures about 19.6 mm corner to corner, and a hole drilled to the first number will not pass it. The table gives both, and gets them the right way round.

The polygons that do not exist, and the ones that cannot be drawn

Type an interior angle of 100° and there is nothing to draw: it would need four and a half sides. Rather than rounding quietly to a pentagon, the tool names the two real polygons on either side — the square at 90° and the regular pentagon at 108° — and offers to use either. The same happens to two lengths whose ratio lands between two polygons, and to a perimeter and an area that no polygon could have together: pack a fixed perimeter as efficiently as you like and a circle is the limit, so a perimeter of 40 can never enclose more than about 127.3.

A different kind of impossibility gets a line of its own. A regular polygon can be constructed exactly with compass and straightedge only when its number of sides is a power of two multiplied by distinct Fermat primes, of which just five are known: 3, 5, 17, 257 and 65537. That is why the pentagon has a classical construction, why Gauss found one for the 17-gon at nineteen and asked for it on his gravestone, and why nobody has ever drawn a regular heptagon exactly with those two instruments. It is not that the construction is difficult. Wantzel proved in 1837 that there is none.

Questions

What counts as a regular polygon?

One where all the sides are the same length and all the angles are the same size — an equilateral triangle, a square, a regular pentagon and so on. A rectangle is not regular, because its angles match but its sides do not; a rhombus is not, for the opposite reason. This tool solves regular polygons only, and that is exactly what lets one measurement fill in everything else. For an irregular polygon the interior angles still add to 180° × (n − 2), but nothing else follows from a single length.

Why was my interior angle of 100° refused?

Because no regular polygon has one. The interior angle is 180° − 360° ÷ n, so 100° would need 4.5 sides. The nearest real answers are the square at 90° and the regular pentagon at 108°, and both are offered as buttons. Values that look far more awkward are often fine: 128.57° is accepted as a heptagon, because the heptagon’s interior angle is 128.5714…° and two decimal places is all you claimed to know.

What is the difference between the exterior angle and the central angle?

They describe different things and are always the same number, 360° ÷ n. The exterior angle is how far you turn at each corner walking round the outline — and since one lap turns you through 360° altogether, each of the n corners has to take 360° ÷ n. The central angle is the slice of the centre that one side subtends, and the n of them fill 360° for the same reason. Switch on the exterior angle to see it drawn on the carried-on side.

What do across flats and across corners mean?

Across flats is the distance between two opposite sides, which is twice the apothem, and it only exists when the number of sides is even. Across corners is the distance between two opposite corners — the longest diagonal, and twice the circumradius for an even polygon. Hexagonal nuts and spanners are sized across the flats, which is why a 17 mm hex bar needs a hole nearer 19.6 mm to pass through.

How many diagonals does a polygon have?

n × (n − 3) ÷ 2. Each of the n corners joins to every corner except itself and its two neighbours, which is n − 3 apiece, and that counts each diagonal from both ends. A triangle has none, a square has two, a hexagon has nine. There are far fewer distinct diagonal lengths than diagonals — a hexagon’s nine come in only two lengths — so the table lists the lengths rather than repeating them.

Does anything I type leave my browser?

No. It is a page of trigonometry running on your own device, with no server involved at any point. Nothing is uploaded, stored or logged.

Updated 2026-08-21. Runs fully in your browser — nothing is uploaded.