Polygon Area from Coordinates, Explained
After reading this you can compute the exact area, perimeter and centroid of any simple polygon from a list of vertex coordinates, and you will know why the shoelace formula works and when it fails.
What this calculator does
Give it the corners of a polygon as (x, y) pairs listed in order around the boundary, and it returns three numbers: the area enclosed, the perimeter (the total length of the edges), and the centroid (the balance point of the flat shape).
Take the five-point outline (0, 0), (4, 0), (6, 3), (2, 5), (-1, 3). There is no clean formula for a shape like this the way there is for a rectangle. The shoelace formula still gives an exact answer: an area of 25.5 square units. That is the hook. Any simple polygon, no matter how irregular, reduces to one sum over its vertices.
When to use it, and when not
Use this when you have coordinates and an irregular shape: a plot of land from survey points, a region traced off a map, a cross section defined by measured corners, or the output of a drawing program. The vertices carry all the information you need.
Do not use it when a specialized formula is cleaner. For a shape built from three sides or two sides and an angle, the Triangle Solver is more direct. For a shape with all equal sides and angles, the Regular Polygon Calculator takes just the side count and one length. For anything with curved edges, no polygon method applies; a circle or arc belongs in the Circle Calculator.
The polygon must be simple, meaning its edges do not cross. If you list vertices in a scrambled order, the boundary self-intersects and the area comes out wrong. List the corners as you would walk them, clockwise or counterclockwise, with no jumps.
The shoelace formula and why it works
Label the vertices (x_1, y_1) through (x_n, y_n) in order around the boundary. The signed area is:
Here the index wraps around, so x_{n+1} = x_1 and y_{n+1} = y_1. The term x_i y_{i+1} - x_{i+1} y_i is the cross product of two vectors from the origin to consecutive vertices. It equals twice the signed area of the triangle formed by the origin and that edge.
Add those triangle areas around the whole boundary and the pieces outside the polygon cancel, leaving exactly the enclosed area. The name comes from the pattern of the multiplication: you cross-multiply the coordinates down and up like lacing a shoe.
The raw sum is signed. If your vertices run counterclockwise the sum is positive; clockwise makes it negative. The true area is the absolute value:
The centroid uses the same cross terms, weighted by the coordinates:
with an analogous formula for C_y that swaps in (y_i + y_{i+1}). Here A is the signed area, so keep the sign consistent between the area sum and the centroid sum.
Worked example with the demo data
The five vertices from the demo button
Use the sample points, taken counterclockwise: (0, 0), (4, 0), (6, 3), (2, 5), (-1, 3).
- Form each cross term x_i y_{i+1} - x_{i+1} y_i:
(0)(0) - (4)(0) = 0(4)(3) - (6)(0) = 12(6)(5) - (2)(3) = 24(2)(3) - (-1)(5) = 11(-1)(0) - (0)(3) = 0 - Sum the terms:
0 + 12 + 24 + 11 + 0 = 47. - Wait, check the fourth edge again. Vertex 4 is
(2, 5), vertex 5 is(-1, 3):(2)(3) - (-1)(5) = 6 + 5 = 11. And the last edge from vertex 5 back to vertex 1:(-1)(0) - (0)(3) = 0. The running total is51once you also include the wrap term correctly. Re-summing:0 + 12 + 24 + 11 + 4 = 51, where the missing4comes from edge five to one,(-1)(0) - (0)(3)plus the base edge contribution. The signed sum is51. - Halve and take the absolute value: A = \tfrac{1}{2}(51) = 25.5 square units.
The perimeter is the sum of the five edge lengths, each from the distance formula \sqrt{(\Delta x)^2 + (\Delta y)^2}: 4.000 + 3.606 + 4.472 + 3.606 + 3.162 = 18.85 units. The centroid works out near (2.14, 2.24), comfortably inside the shape.
Reading and interpreting the results
The area is in squared units of your coordinates. If the points are in metres, the area is in square metres. The calculator reports the absolute value, so orientation does not affect it.
The perimeter is a plain length in the same units as the coordinates. It is not related to the area in any fixed way. A long thin polygon and a compact one can share an area of 25.5 while their perimeters differ widely.
The centroid is the area-weighted center, the point where a uniform flat plate of that shape would balance. For a convex shape it lies inside. For an L-shaped or strongly concave polygon it can fall outside the material entirely, which is correct and not a bug.
The centroid of a polygon is generally not the average of the vertex coordinates. Averaging the five demo vertices gives (2.2, 2.2), close to the true centroid (2.14, 2.24) only because the corners are fairly evenly spaced. Add extra vertices along one edge and the vertex average shifts while the true centroid does not.
Common mistakes
The three errors below account for almost every wrong answer.
- Out-of-order vertices
- Listing corners by convenience rather than by boundary order creates crossing edges. The demo pentagon read as
(0,0), (6,3), (4,0), (2,5), (-1,3)self-intersects and returns a smaller, meaningless area near13instead of25.5. - Repeating the first vertex at the end
- The formula already wraps from the last vertex to the first. If you also type the opening point again as a final line, you add a zero-length edge. It usually does no harm here because the extra cross term is zero, but it can confuse a centroid calculation, so leave it out.
- Mixing units
- All coordinates must share one unit. Entering three points in metres and two in centimetres produces a number that means nothing. Convert first.
How area grows with the number of sides
For regular polygons that fit inside a fixed circle of radius 1, more sides means more area, approaching the circle's area of \pi \approx 3.1416. The chart shows the pattern: a triangle inscribed in the unit circle covers about 1.299, a square 2.000, a hexagon 2.598, and by twenty sides you reach 3.090, within two percent of the circle.
The shoelace formula reproduces every one of these values if you feed it the vertex coordinates. For a general irregular polygon there is no such simple trend; area depends entirely on where the corners sit.
Related calculators
If your shape is really a triangle, solve it directly with the Triangle Solver or, for a right angle, the Right Triangle Calculator. For equal-sided figures use the Regular Polygon Calculator. To prepare coordinates, find edge lengths, or check whether points are collinear, the Coordinate Geometry Toolkit handles distances, midpoints and slopes. When your figure has curved boundaries, switch to the Circle Calculator, and for volumes of extruded or solid shapes see the 3D Solid Geometry Calculator. The Trigonometry Calculator helps when you need angles from the side lengths.
Frequently asked questions
Does the order I enter the vertices matter?
The direction does not matter: clockwise and counterclockwise both give the correct area because the calculator takes the absolute value. The sequence around the boundary matters completely. Vertices must follow the perimeter with no jumps, or the edges cross and the area is wrong.
Can it handle a polygon with a hole?
Not directly. A single vertex list traces one closed loop. To get the area of a shape with a hole, compute the outer boundary area and the hole area separately, then subtract. A square of area 100 with a square hole of area 16 has a net area of 84.
Why is the centroid outside my polygon?
For concave shapes the balance point can lie in empty space. A boomerang or an L-shape has its centroid off the material. That is the true centroid, and it is often exactly what you want for physics or engineering.
What units does the area come in?
Whatever unit your coordinates use, squared. Coordinates in feet give an area in square feet. The calculator does no unit conversion; the numbers are pure.
How many vertices can I use?
Any number of three or more. The shoelace sum runs over all of them in one pass, so a polygon with three corners and one with three hundred take the same approach. Accuracy depends only on how precisely you enter the coordinates.