Home / Coordinates and Location Formats

How to Find Centroid Coordinates: Points, Triangles, Polygons, and Places on Earth

Colleagues in discussion around a laptop showing a global business presentation

Photo: fauxels / Pexels

"Find the centroid" sounds like one task, but it is four, and using the wrong one is the classic way to get a confidently wrong answer. A scatter of points, a triangle, a polygon with area, and a set of places on a curved Earth each balance differently. This guide works all four methods with numbers you can verify as you read: the direct average, the triangle shortcut, the shoelace formula on an L shaped polygon where the naive answer is visibly wrong, and the spherical correction for geographic points, where one popular web answer is wrong by roughly 290 kilometers and this guide shows the correct figure.

Interactive map

Coordinate Explorer: Click Your Points, Read Their Pairs

Click each of your points on the map and note the exact pair it reports. Average the latitudes and the longitudes for the point centroid, and use this article shoelace method when your points outline an area instead.

Decimal degrees40.689167, -74.044444
Latitude40.689167° N
Longitude74.044444° W
Degrees minutes seconds40° 41' 21.00" N, 74° 02' 40.00" W
Degrees decimal minutes40° 41.350' N, 74° 02.667' W
Plus code87G7MXQ4+M67

Map data © OpenStreetMap contributors. Coordinates are read from the map itself, in the WGS 84 system your phone uses.

Method One: The Centroid of a Set of Points

For separate points with no area, the centroid is the plain average of the coordinates. Add the x values and divide by the count; do the same for y.

Worked example. Points (2, 3), (5, 7), (8, 3), (5, 1). The x values sum to 2 + 5 + 8 + 5 = 20, divided by 4 gives 5. The y values sum to 3 + 7 + 3 + 1 = 14, divided by 4 gives 3.5. The centroid is (5, 3.5). This is the center of mass of equal weights at the four points, and it is the right answer for delivery points, sensor locations, photo locations, and any "average position" question where each point counts once. Weighted versions exist, where a busier location counts double, but the unweighted average is the default the word centroid means for point sets.

Method Two: The Centroid of a Triangle

A triangle's centroid is the average of its three vertices, which is also where its three medians cross, and where the triangle would balance on a pin.

Worked example. Vertices (0, 0), (6, 0), (3, 6). Average x: (0 + 6 + 3) / 3 = 3. Average y: (0 + 0 + 6) / 3 = 2. Centroid: (3, 2). Notice it sits one third of the height up from the base, the fact every geometry student meets as the two to one median rule: the centroid divides each median so the part toward the vertex is twice the part toward the side. For triangles, and only triangles, the vertex average and the true area centroid coincide, which is why this shortcut is safe here and treacherous in the next section.

Method Three: The Centroid of a Polygon, by Shoelace

For a polygon with area, averaging the vertices is wrong whenever the vertices are unevenly spread, because corners clustered along one edge drag the average toward themselves although the area is elsewhere. The correct method is the shoelace based centroid formula. List the vertices in order around the shape, closing back to the first. For each edge from (x_i, y_i) to (x_{i+1}, y_{i+1}), compute the cross term c_i = x_i y_{i+1} - x_{i+1} y_i. The signed area is A = (1/2) sum of c_i. Then Cx = (1 / (6A)) sum of (x_i + x_{i+1}) c_i, and Cy = (1 / (6A)) sum of (y_i + y_{i+1}) * c_i.

Worked example: an L shape. Vertices in order: (0, 0), (6, 0), (6, 2), (2, 2), (2, 6), (0, 6). The cross terms per edge are 0, 12, 8, 8, 12, 0, summing to 40, so A = 20, which checks out by eye: the L is a 6 by 2 bar plus a 2 by 4 bar, 12 + 8 = 20. The Cx sum: (0+6)0 + (6+6)12 + (6+2)8 + (2+2)8 + (2+0)12 + (0+0)0 = 0 + 144 + 64 + 32 + 24 + 0 = 264. Cx = 264 / (6 * 20) = 264 / 120 = 2.2. By the shape's symmetry across the diagonal, Cy is also 2.2. The polygon centroid is (2.2, 2.2).

Now the warning in numbers: the naive vertex average of the same L is ((0+6+6+2+2+0)/6, (0+0+2+2+6+6)/6) = (2.67, 2.67), pulled up and right by the clustered inner corners, and it actually falls in the missing notch of the L, outside the material entirely. A centroid outside the shape is legal for area, donuts and crescents do it too, but here it signals the wrong method, not a quirky shape. Use the shoelace formula for anything with area.

Method Four: Centroids of Places on Earth

Latitude and longitude points average like any points when they are close together. Three towns at (40.0, -75.0), (41.0, -74.0), (40.5, -73.5) average to latitude (40.0 + 41.0 + 40.5) / 3 = 40.5, longitude (-75.0 - 74.0 - 73.5) / 3 = -74.1667: centroid (40.5, -74.1667), a perfectly good answer at this scale.

Spread the points across a continent and the flat average quietly fails, because longitude degrees shrink toward the poles and the shortest paths curve. The correct geographic mean converts each point to a 3D unit vector, averages the vectors, and converts back. Worked example: San Francisco (37.7749, -122.4194) and New York (40.7128, -74.0060). The flat average is (39.24, -98.21). The spherical mean is (41.85, -98.75), roughly 290 kilometers north of the flat answer, because the true midpoint of the great circle route bows toward the pole. Beware: at least one widely copied web page presents the flat average as the spherical answer for exactly this pair. The arithmetic in this paragraph was verified by direct vector computation, and the moral generalizes: for points within one region, average freely; for points across a continent or an ocean, do the spherical version or use a tool that does. The explorer above lets you click your points and read their coordinates exactly, which is the honest first step for either method, and our latitude and longitude practice set drills the pair handling underneath all of this.

Team collaborating on business strategy with laptop displaying global analytics
Team collaborating on business strategy with laptop displaying global analytics

The Software Route: QGIS and Friends

In QGIS, the centroid of a polygon layer is one command: Vector, then Geometry Tools, then Centroids, which applies the shoelace mathematics of Method Three to every feature and creates a point layer. Spreadsheets handle Methods One and Two with AVERAGE over coordinate columns. GIS professionals check one thing beginners forget: the layer's coordinate system. Centroids computed in a degree based system over a wide area inherit the flat average distortions of Method Four; project the layer to a flat system appropriate to the region first, then take centroids. Our GIS for beginners guide sets up the coordinate system thinking that makes this automatic, and add GPS coordinates to QGIS covers getting point data in to average in the first place.

Four methods, four balance points. Match the method to the material, points, triangle, polygon, or planet, and the centroid you report will be the one the shape actually balances on.

Weighted Centroids: When Points Count Unequally

Real point sets rarely deserve equal votes. A delivery firm locating a depot among its customers should weight each customer by order volume; a retailer averaging store locations should weight by revenue; a school district placing a bus depot should weight by students. The weighted centroid adjusts Method One in the obvious way: multiply each coordinate by its point's weight, sum, and divide by the total weight instead of the count.

Worked example. Three stops at (2, 3), (5, 7), and (8, 3), where the first stop generates twice the trips of each other. Weights 2, 1, 1. Weighted x: (22 + 51 + 81) / (2+1+1) = (4 + 5 + 8) / 4 = 17 / 4 = 4.25. Weighted y: (32 + 71 + 31) / 4 = (6 + 7 + 3) / 4 = 16 / 4 = 4.0. The weighted centroid is (4.25, 4.0), pulled from the unweighted answer toward the busy stop at (2, 3), exactly as it should be. The judgment call is choosing weights honestly: weight by what the center is for, trips, people, revenue, and not by what flatters a preferred answer. A centroid is an argument made of arithmetic, and the weights are where the argument lives.

One More Idea: Mean Center Versus Median Center

Two refinements complete the beginner's map of this topic. The centroid of points in this article is the mean center, the average position, and like every mean it is sensitive to outliers: one far flung point drags it noticeably. Planners sometimes prefer the median center, the point minimizing total travel distance to all points, which resists outliers and answers the practical question "where do we meet to minimize everyone's journey." It has no tidy formula and is found by iteration, but the distinction explains many arguments about "the center" of a spread of places: the two centers are different points answering different questions, and naming which one you computed ends the argument. Our latitude and longitude questions and answers set touches the same distinction from the quiz side.

Related Guides

The closest companions to this guide are the coordinates guides below. Each one picks up a thread this page starts:

Frequently Asked Questions

What is a centroid in simple terms?

It is the balance point: the single point where a flat shape would balance on a pin, or the average position of a set of points. For points it is the mean of the coordinates. For shapes with area it is the center of area, computed with the shoelace based formula so that every part of the area counts equally.

Can I find a polygon centroid by averaging its corners?

Only for triangles, where the vertex average is exactly right. For other polygons, clustered corners drag the average away from the center of area. In this article's L shaped example the corner average lands at (2.67, 2.67), inside the shape's missing notch, while the true area centroid is (2.2, 2.2). Use the shoelace formula for polygons.

Can a centroid fall outside the shape?

Yes, legitimately. Crescent, donut, and C shaped areas balance at points in their empty middle. It is only a warning sign when the method was wrong, as with vertex averaging, or when the shape is simple and convex, in which case an outside centroid always means an arithmetic error.

How do I find the centroid of latitude and longitude points?

For points within a city or region, average the latitudes and longitudes directly. For points spread across a continent, convert each point to a 3D vector, average the vectors, and convert back; the flat average can err by hundreds of kilometers, as the San Francisco to New York example in this article shows.

How does QGIS calculate centroids?

QGIS's Centroids tool applies the standard polygon centroid formula, the shoelace based method, to each feature's geometry. Results depend on the layer's coordinate system: run it on a projected, meter based system for a region rather than on raw degrees, or wide area centroids inherit the distortions of flat averaging on a curved Earth.

What is the difference between a centroid and a center point on a map?

Map software often offers both. A centroid is the mathematical balance point and can fall outside an irregular shape or even in water for a coastal region. A "point on surface" or label point is guaranteed inside the shape, chosen for display. Use centroids for analysis, surface points for labels and markers.

Photo credits: fauxels (Pexels); fauxels (Pexels). Photos are served from this site; follow the credit to the library page for the original.