Advanced maths

Polygon area and centroid calculator

Calculate a simple polygon’s exact area and centroid from its ordered vertices.

Your numbers

Enter 3 to 100 points in boundary order, one x,y pair per line or separated by semicolons. The closing edge is automatic; repeating the first point once at the end is allowed.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your numbers and select Calculate.

Behind the numbers

How this calculation works

The shoelace sum includes the last-to-first edge and gives signed area. Its sign identifies orientation; half its absolute value is the area. Weighted cross terms give the area centroid. The boundary is checked for self-crossings, nonadjacent touches and overlaps before area is interpreted as a simple polygon.

THE FORMULASigned 2A = Σ(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ); Cx = Σ(xᵢ+xᵢ₊₁)crossᵢ/(6A)

A worked example

The boundary (0,0), (4,0), (4,3), (0,3) gives area 12, perimeter 14 and centroid (2,3/2).

Good to know

Flat Cartesian coordinates with matching units. Each component is between −1,000,000 and 1,000,000; decimal inputs allow up to 6 places and integer fractions have denominators up to 1,000,000. Expressions are not parsed. Exact intermediate fractions have a size limit; reduce unusually complex inputs if that limit is reached. Lengths and angles are decimal approximations.

A little curiosity

A boundary is more than an unordered list of points

The vertices must follow the polygon edge by edge. A shuffled collection can describe a different shape or a crossing boundary. The tool connects the last point back to the first automatically, so every boundary edge participates in the calculation.

Clockwise and counterclockwise input orders give the same area and centroid. Their signed shoelace sums have opposite signs, which is why orientation is reported separately. Reversing an entire valid boundary is different from shuffling only some vertices.

A bow-tie boundary crosses itself. Its signed area can cancel even though there are visible lobes. This page rejects such boundaries rather than silently interpreting their algebraic area as the ordinary area of a simple polygon.

The area centroid need not be the vertex average

For a general polygon, simply averaging the vertices does not give the area centroid. Adding an extra vertex along one straight edge would change that average even though the enclosed region stayed identical. Cross-weighted area contributions avoid that problem.

A concave polygon can have a centroid outside its material region. That is not automatically an error. The centroid is the balance point of a uniform filled lamina, not a promise that a pin placed there would be inside the shape.

The supported boundary is one simple loop without holes. Nonadjacent edge touches, repeated interior vertices and overlapping edges are rejected as well as crossings. A single repeated first vertex at the end is accepted as an explicit closure and removed before calculating.

A few questions, answered

How many vertices are supported?

From 3 to 100, with rational component and intermediate-size limits. The outline omits individual text labels above 12 vertices to keep it readable.

Can consecutive vertices lie on one straight edge?

Yes, if they continue along the boundary without backtracking or overlapping. The shape still needs a nonzero enclosed area.

Can I calculate the area of a plot of land?

Only after representing it in an appropriate flat coordinate system with consistent units. Raw latitude/longitude and curved Earth distances are not handled here.

Find your calculator

Start typing to explore the library.