Skip to content
D DocNectar

Free Centroid Calculator

Find a polygon's area-weighted geometric centroid from its vertex coordinates.

100% Free No Signup Works on all devices

Built and fact-checked by the DocNectar team — see our editorial standards

Thanks for rating!

Key Features

Instant Calculation

Get accurate results in real time with our optimized algorithm.

Mobile Friendly

Fully responsive design. Works on all devices & screen sizes.

Privacy Focused

Your data stays on your device. We don't store any inputs.

100% Free

No hidden costs. This tool is completely free forever.

A polygon's centroid is its geometric "center of area" — the balance point of the shape if it were cut from a uniform sheet of material and balanced on a pin. It's distinct from simply averaging the vertex coordinates, since a plain vertex average treats every corner equally, while the true centroid properly weights by exactly how the polygon's area is spread out, giving more influence to regions with more actual interior area nearby. Centroids matter wherever a shape's mass or area needs to be treated as concentrated at a single representative point: structural engineers use a cross-section's centroid to compute bending stresses in beams, CAD and CNC systems use it to center a part for machining or 3D printing, and computer graphics uses polygon centroids for placing labels, computing physics simulations, and mesh processing.

How it works

Choose the number of vertices (3 to 10) and enter each (x, y) coordinate in order around the polygon. The calculator first computes the polygon's signed area A using the Shoelace formula, then applies the centroid formulas Cx = (1/6A)·Σ(xᵢ+xᵢ₊₁)(xᵢyᵢ₊₁−xᵢ₊₁yᵢ) and Cy = (1/6A)·Σ(yᵢ+yᵢ₊₁)(xᵢyᵢ₊₁−xᵢ₊₁yᵢ), summing over each consecutive pair of vertices (wrapping the last vertex back to the first). These formulas essentially break the polygon into thin triangular wedges from the origin, weight each wedge's contribution by both its area and its position, and combine them — which is exactly why the result differs from a plain average whenever the polygon's area isn't evenly spread relative to its vertices.

  1. Enter number of vertices.
  2. Enter vertex 1 — x.
  3. Enter vertex 1 — y.
  4. Enter vertex 2 — x.
  5. Enter vertex 2 — y.
  6. Enter vertex 3 — x.
  7. Enter vertex 3 — y.
  8. Enter vertex 4 — x.
  9. Enter vertex 4 — y.
  10. Enter vertex 5 — x.
  11. Enter vertex 5 — y.
  12. Enter vertex 6 — x.
  13. Enter vertex 6 — y.
  14. Enter vertex 7 — x.
  15. Enter vertex 7 — y.
  16. Enter vertex 8 — x.
  17. Enter vertex 8 — y.
  18. Enter vertex 9 — x.
  19. Enter vertex 9 — y.
  20. Enter vertex 10 — x.
  21. Enter vertex 10 — y.
  22. Click Calculate to see your results.

Examples

Unit square (0,0), (1,0), (1,1), (0,1)

Area = 1, and the centroid works out to (0.5, 0.5) — the exact center, as expected for a shape that's symmetric in every direction.

Right triangle (0,0), (4,0), (0,3)

Area = 6 (matching ½ × 4 × 3). The centroid formula gives (4/3, 1) ≈ (1.33, 1) — which, for a triangle specifically, happens to equal the simple average of its three vertices, (0+4+0)/3 and (0+0+3)/3. This vertex-average shortcut works only for triangles, not for polygons in general.

Trapezoid (0,0), (6,0), (4,3), (1,3)

Area = 13.5. The true area-weighted centroid comes out to approximately (2.78, 1.33) — noticeably different from the plain average of the four vertices, which would incorrectly give (2.75, 1.5). This gap is exactly why the area-weighted formula matters for anything beyond a triangle.

Common mistakes to avoid

  • Entering vertices out of order around the polygon, which produces an incorrect, self-intersecting shape and a meaningless centroid.
  • Assuming the centroid equals the average of the vertex coordinates for any polygon — that shortcut only holds exactly for triangles.
  • Confusing the geometric centroid (area-weighted, assumes uniform density) with a mass-weighted center of mass, which can differ if density varies across the shape.
  • Forgetting that a concave polygon can have a centroid that lies outside its own visible boundary.

Frequently asked questions

Only for a triangle, where the two happen to coincide as a special mathematical property. For any polygon with four or more vertices, the area-weighted centroid formula generally gives a different (and correct) result from a simple vertex average.
A triangle's area is always evenly distributed relative to its three corners in a way that makes the weighted formula reduce exactly to the simple average. Once you add a fourth vertex, the area can be distributed unevenly across the shape's "wedges," and the plain average of coordinates no longer accounts for that.
Consistent ordering (all clockwise or all counterclockwise) is still required to correctly define the polygon's edges, but the final centroid position comes out the same regardless of which direction you traced — the underlying shape doesn't change.
For a concave (non-convex) polygon, yes — a shape with a deep notch or indentation can have a centroid that lands in the "missing" region outside the actual boundary, similar to how a crescent moon's balance point sits outside the crescent itself.
For a flat shape of uniform density, they're identical. Center of mass becomes a distinct calculation only when different regions (or different point masses) carry different weights or densities, which the plain geometric centroid formula doesn't account for.
Dividing by area — rather than vertex count — is precisely what makes the formula weight each part of the polygon by how much actual area it contributes, rather than treating every corner as equally important regardless of the shape between them.

Get new calculators and guides in your inbox

No spam — just new tools like Centroid Calculator and practical guides.

Favorites