🏆 US-Registered Digital Marketing Agency Trusted by 200+ brands · USA · UK · Canada · AUS
Advertisement
Advertisement
GEOMETRY

Polygon Calculator — regular n-gons and irregular shapes from coordinates

Solve any regular polygon from one measurement, or find the area of a completely irregular outline using the shoelace formula.

Regular means every side and every angle is identical. Anything else needs coordinates.
Three or more. Try 7 for a heptagon, 12 for a dodecagon.
Area
363.39 cm²
 
70 cm
Perimeter
10.38 cm
Apothem
128.57°
Interior angle
51.43°
Exterior angle
Working:  
Advertisement

The polygon calculator above does two separate jobs. In regular mode it solves any polygon with three or more equal sides — heptagon, nonagon, dodecagon, anything — from a side length, an apothem or a circumradius. In irregular mode it takes a list of corner coordinates and returns the exact area of the outline they describe, using the shoelace formula.

That second mode is the one most calculators skip, and it is the one that handles real shapes. A surveyed plot, a scanned floor plan, a digitised map boundary or a CAD outline all arrive as a list of points, not as a neat set of equal sides. Arb Digital built this page so both cases live in one place, because the question "what is the area of this shape" rarely arrives already sorted into regular and irregular.

What This Polygon Calculator Does

In regular mode it returns the area, perimeter, apothem, interior angle and exterior angle. A regular heptagon with 10 cm sides has an area of about 363.39 cm², a perimeter of 70 cm, an apothem of 10.383 cm, interior angles of 128.571° and exterior angles of 51.429°.

In irregular mode it returns the area from the shoelace formula, the perimeter summed edge by edge, the vertex count, and the centroid coordinates. The default coordinate list describes a five-sided shape — a rectangle with a peak on top — with an area of exactly 33 square units and a centroid at (3, 2.818).

If you need a specific named shape with dedicated notes, we have separate pages for the pentagon calculator, hexagon calculator and octagon calculator. This page is the general case behind all three.

How to Use It

  1. Pick the mode. Regular if every side is identical; irregular if they are not, or if you already have coordinates.
  2. In regular mode, set n and one measurement. The apothem and circumradius are both measured from the centre — the apothem to the middle of a side, the circumradius to a corner.
  3. In irregular mode, list the corners in order around the outline, one "x,y" pair per line. Order matters enormously; jumping around produces a self-crossing shape and a wrong area.
  4. Do not repeat the first point at the end of the list. The calculator closes the shape for you.
  5. Read the working line to see the formula applied to your own numbers, including the shoelace cross-product sum.

The Formula: Regular Polygons and the Shoelace Method

For a regular polygon with n sides of length s, the area is A = (n / 4) s² cot(π/n). For a heptagon with s = 10, that is (7/4) × 100 × cot(π/7) = 1.75 × 100 × 2.07652 ≈ 363.39. Every named-shape constant is this formula with n filled in: n = 5 gives 1.720477, n = 6 gives 2.598076, n = 8 gives 4.828427.

The equivalent and more intuitive form is A = ½ × perimeter × apothem, which follows from splitting the polygon into n identical triangles from the centre. With a perimeter of 70 and an apothem of 10.3826, that is ½ × 70 × 10.3826 = 363.39 — the same answer. MathWorld's regular polygon entry lists the full family of relations.

For an irregular polygon, the shoelace formula gives the exact area from the vertices alone:

A = ½ |Σ (xi · yi+1 − xi+1 · yi)|, with the last vertex wrapping round to the first.

Advertisement

Working the Shoelace Formula by Hand

The name comes from how you lay it out: write the coordinates in a column, repeat the first at the bottom, then cross-multiply diagonally like lacing a shoe. Take the default shape, with corners at (0,0), (6,0), (6,4), (3,7) and (0,4).

Each term is xiyi+1 − xi+1yi. Going round: (0×0 − 6×0) = 0; (6×4 − 6×0) = 24; (6×7 − 3×4) = 30; (3×4 − 0×7) = 12; and closing back to the start, (0×0 − 0×4) = 0. The sum is 66, and half of that is 33 square units — which is what the calculator reports.

Check it a second way to be sure. The shape is a 6 by 4 rectangle with a triangle on top whose base is 6 and whose height is 3. That gives 24 + ½ × 6 × 3 = 24 + 9 = 33. The two methods agree, which is the point of hand-checking: the shoelace formula is mechanical and easy to trust, but it is also easy to mistype a coordinate, and a second route catches that.

The formula works for any simple polygon, convex or concave, with any number of vertices. It is the standard method in GIS software and CAD, and MathWorld sets out the derivation on its polygon area page.

Vertex Order Is Not Optional

The shoelace formula assumes the vertices are listed in sequence around the boundary. List them out of order and you describe a different shape entirely — usually a self-intersecting one — and the formula will still return a number, just not the number you wanted. Because the terms are signed, the crossing regions partly cancel, so the result is typically smaller than the true area rather than obviously wrong.

This is the main failure mode when the coordinates come from a spreadsheet or a data export, where rows may be sorted by something other than the path around the shape. The fix is to plot the points before trusting the answer, even roughly on paper. If the outline you draw crosses itself, the list is out of order.

Direction, on the other hand, does not matter. Anticlockwise ordering gives a positive signed sum and clockwise gives a negative one, but the calculator takes the absolute value. The sign is still information — GIS systems use it to distinguish outer boundaries from holes cut inside them — but for a single area it is irrelevant.

The Centroid, and What It Is Not

The calculator reports the centroid of an irregular polygon: the area-weighted centre, the point where a uniform sheet cut to that outline would balance. It is computed from the same cross-product terms as the area, weighted by the coordinates.

It is worth being clear about what the centroid is not. It is not the average of the vertex coordinates — that is the centre of the corner points, which is a different point unless the vertices happen to be evenly distributed. For our default shape, averaging the five vertices gives (3, 3), while the true area centroid is (3, 2.818). The difference arises because the bulk of the area sits low in the shape while two of the five corners sit high.

It is also not the centre of the bounding box, and it need not lie inside the polygon at all. A strongly concave shape — a crescent, a horseshoe, an L with long arms — can have its centroid in empty space outside the outline. That is not an error in the calculation; it is a genuine property of the shape.

Angles in Any Polygon

Two rules hold for every simple polygon, regular or not. The interior angles sum to (n − 2) × 180°, because any n-gon divides into n − 2 triangles from a single vertex. The exterior angles always sum to 360°, no matter how many sides there are or how irregular the shape is — walk once round the boundary and you have turned through exactly one full circle.

For a regular polygon those totals divide evenly, so each interior angle is (n − 2) × 180° / n and each exterior angle is 360° / n. A heptagon gives 128.571° and 51.429°. The exterior angle is the more useful of the two for fabrication, since it is the turn at each corner: a frame of n equal pieces needs a mitre of half the exterior angle at each end, so 180°/n. For a heptagon that is about 25.7°, and for a dodecagon exactly 15°.

As n grows, the shape approaches a circle. A regular 100-sided polygon with a circumradius of 10 has an area of about 313.95 against the circle's 314.16 — within 0.07%. This is essentially how Archimedes bounded π, by squeezing a circle between inscribed and circumscribed polygons with ever more sides. Our circle calculator handles the limiting case directly.

Getting Coordinates for a Real Plot

The practical obstacle to using the shoelace method is producing the coordinates. For a plot of land, the usual approach is a local grid: pick one corner as the origin, set one boundary as the x-axis, and measure each remaining corner as an offset east and north of that origin. Any consistent set of axes works, because area is unchanged by rotating or shifting the whole shape.

Where a shape has curved boundaries — a riverside plot, a road with a bend — approximate the curve with a series of short straight segments. More points give a better approximation, and the error falls quickly. The shoelace formula does not care whether you use five vertices or five hundred.

Once you have the area, take it onward to a materials tool rather than ordering to the bare figure: our flooring calculator and concrete calculator apply waste and depth allowances, and the area converter moves a result between square metres, square feet and acres.

Free tools like this one earn traffic every day without paying per click.

Arb Digital designs and builds calculators that answer a question properly, rank for the searches behind it, and bring the right people to your business. Browse the full set, or talk to us about tools for your own audience.

Browse All Free Tools Talk to Arb Digital

Common Mistakes to Avoid

  • Listing coordinates out of order — the shoelace formula traces the path you give it, and a scrambled list describes a self-crossing shape with a smaller area.
  • Repeating the first point at the end — the calculator closes the loop itself, and a duplicate final vertex adds a zero-length edge to the perimeter.
  • Using the regular formula on an irregular shape — equal side counts do not imply equal sides. Six edges is not a hexagon unless all six match.
  • Averaging vertex coordinates to find the centre — that gives the mean of the corners, not the area centroid, and the two differ for any unevenly shaped outline.
  • Mixing coordinate units — every x and y value must be on the same scale, or the area will be meaningless.

Related Free Tools From Arb Digital

Work with three-sided pieces using the triangle area calculator, handle straight rectangles with the rectangle area calculator, take on four-sided shapes with one parallel pair using the trapezoid calculator, measure boundaries with the perimeter calculator, and convert linear dimensions with the length converter. Everything we publish is in the free online tools hub.

Frequently Asked Questions

What is the shoelace formula?

It calculates the exact area of any simple polygon from its corner coordinates. Multiply each x by the next y, subtract each next x times the current y, sum every term around the shape, then halve the absolute value of that sum.

What is the formula for the area of a regular polygon?

Area equals n divided by 4, times the side length squared, times the cotangent of π divided by n. The equivalent and simpler version is half the perimeter multiplied by the apothem.

Does the order of my coordinates matter?

Yes, critically. The points must follow the boundary in sequence. Direction does not matter, since clockwise and anticlockwise differ only in sign, but a scrambled order describes a self-intersecting shape and gives the wrong area.

Can the shoelace formula handle concave shapes?

Yes. It works for any simple polygon, convex or concave, provided the boundary does not cross itself. Concave corners are handled automatically by the signed terms in the sum.

What is the sum of interior angles in a polygon?

It equals (n − 2) multiplied by 180 degrees, where n is the number of sides. A heptagon totals 900 degrees. The exterior angles always sum to 360 degrees regardless of the number of sides.

Can a polygon's centroid fall outside the shape?

Yes. For strongly concave outlines such as a crescent or an L shape with long arms, the area-weighted centre can lie in empty space beyond the boundary. That is a real property of the shape, not a calculation error.

How many sides can this calculator handle?

Regular mode accepts up to 1,000 sides, by which point the result is within a fraction of a percent of a circle. Irregular mode has no practical limit — paste as many coordinate pairs as your outline needs.

Advertisement
Advertisement

Take it further

Arb Digital assistant

👋 Hey! Want to grow your business? Ask me anything — a free marketing proposal is on the table!