Free Centroid Calculator

Point 1

x
y

Point 2

x
y

Point 3

x
y

Centroid

Select a shape and enter
coordinates to calculate the centroid

What Is a Centroid?

The centroid—also called the geometric center or, for a uniformly dense object, the center of mass—is a pivotal point in geometry and physics. It represents the balance point of a shape: if you placed a pin exactly at this coordinate, the figure would remain perfectly horizontal. The centroid has broad applications, from engineering (load distribution, structural stability) to data science (cluster analysis in K‑means) and computer graphics (pivot points for rotation). This centroid calculator (often referred to as a center‑of‑mass calculator or geometric‑center calculator) provides a fast, accurate way to determine the centroid coordinates for any supported shape or point set.

Basic Centroid Formula

The simplest way to calculate the centroid is to take the arithmetic mean of all the points that define the shape. Consider a set of kk vertices (x1,y1),(x2,y2),…,(xk,yk)(x_1,y_1),(x_2,y_2),\dots,(x_k,y_k). The centroid (Gx,Gy)(G_x,G_y) is:

Gx=x1+x2+⋯+xkk,Gy=y1+y2+⋯+ykkG_x = \frac{x_1 + x_2 + \cdots + x_k}{k}, \qquad G_y = \frac{y_1 + y_2 + \cdots + y_k}{k}

This formula works directly for triangles and for collections of points. For more complex polygons, an area‑weighted variant is needed (see the polygon section). It is worth noting that for convex shapes the centroid always lies inside, while for concave shapes it may fall outside the boundary.

Triangle Centroid

The centroid of a triangle is the average of its three vertex coordinates. If A=(X1,Y1)A=(X_1,Y_1), B=(X2,Y2)B=(X_2,Y_2), C=(X3,Y3)C=(X_3,Y_3), then:

G=(X1+X2+X33,  Y1+Y2+Y33)G = \left( \frac{X_1 + X_2 + X_3}{3},\; \frac{Y_1 + Y_2 + Y_3}{3} \right)

Geometrically, the triangle centroid is the intersection point of the three medians (segments joining each vertex to the midpoint of the opposite side). It divides each median in a 2:12:1 ratio, with the longer portion closer to the vertex. Unlike some other triangle centers (such as the circumcenter or orthocenter), the centroid always lies inside the triangle, regardless of whether the triangle is acute, right, or obtuse.

Centroids of Special Triangles

  • Equilateral triangle (side length aa): G=(a2,  a36)G = \left( \dfrac{a}{2},\; \dfrac{a\sqrt{3}}{6} \right).
  • Isosceles triangle (leg length ll, height hh): G=(l2,  h3)G = \left( \dfrac{l}{2},\; \dfrac{h}{3} \right).
  • Right triangle (legs bb horizontal, hh vertical): G=(b3,  h3)G = \left( \dfrac{b}{3},\; \dfrac{h}{3} \right).

(Note: “midpoint of a triangle” is not a standard expression—midpoint applies only to line segments. The centroid is the correct term for the median intersection point.)

Centroid of a Set of Points

Given kk points with coordinates (xi,yi)(x_i,y_i), the centroid is simply the coordinate‑wise average:

Gx=1k∑i=1kxi,Gy=1k∑i=1kyiG_x = \frac{1}{k}\sum_{i=1}^{k} x_i, \qquad G_y = \frac{1}{k}\sum_{i=1}^{k} y_i

This point minimizes the sum of squared distances from all points to itself, making it a core element in K‑means clustering and many other data‑analysis techniques. In the calculator, select the “N‑points” option, enter the number of points, and input the coordinates to obtain the centroid instantly.

Polygon Centroid: General Case

For a polygon defined by nn vertices (x1,y1),(x2,y2),…,(xn,yn)(x_1,y_1),(x_2,y_2),\dots,(x_n,y_n) entered sequentially (the polygon is closed, so xn+1=x1x_{n+1}=x_1 and yn+1=y1y_{n+1}=y_1), the centroid depends on the polygon’s signed area AA:

A=12∑i=1n(xiyi+1−xi+1yi)A = \frac{1}{2}\sum_{i=1}^{n} (x_i y_{i+1} - x_{i+1} y_i) Cx=16A∑i=1n(xi+xi+1)(xiyi+1−xi+1yi)C_x = \frac{1}{6A}\sum_{i=1}^{n} (x_i + x_{i+1})(x_i y_{i+1} - x_{i+1} y_i) Cy=16A∑i=1n(yi+yi+1)(xiyi+1−xi+1yi)C_y = \frac{1}{6A}\sum_{i=1}^{n} (y_i + y_{i+1})(x_i y_{i+1} - x_{i+1} y_i)

These formulas handle any closed, non‑self‑intersecting polygon (convex or concave) and require only the vertex coordinates in order. The tool implements this universal method, so you never need to resort to shape‑specific shortcuts.

How to Use the Centroid Calculator

  1. Choose the shape type from the dropdown menu (e.g., triangle, N‑sided polygon, or N‑points).
  2. If you selected a polygon, specify the number of vertices NN (maximum 10).
  3. Enter the Cartesian coordinates for each vertex (or point) in the fields provided.
  4. Click the compute button to see the centroid coordinates.

Example – Trapezoid:
Vertices: A(1,1),  B(2,4),  C(5,4),  D(11,1)A(1,1),\; B(2,4),\; C(5,4),\; D(11,1).
With N=4N=4 and the coordinates entered, the calculator returns (4.974,  2.231)(4.974,\;2.231).

Example – Rectangle:
Vertices: (0,0),  (4,0),  (4,3),  (0,3)(0,0),\; (4,0),\; (4,3),\; (0,3).
The centroid is (2,1.5)(2,1.5), matching the geometric intuition.

Shape Requirements

The calculator accepts any closed, non‑self‑intersecting polygon with at most ten vertices. This includes triangles, all quadrilaterals (rectangles, trapezoids, kites, parallelograms, rhombuses, irregular quadrilaterals), pentagons, hexagons, and so on. It also supports arbitrary point sets without area restrictions. If your shape exceeds the vertex limit, subdivide it into smaller polygons and compute the composite centroid using area‑weighted averaging – but the tool itself handles up to ten vertices per polygon.

FAQ

1. How do I find the centroid of a triangle using this centroid calculator?

Select the triangle option (or choose N‑sided polygon with N=3) and enter the coordinates of the three vertices. The calculator returns the average of the vertex coordinates, which is the triangle's centroid.

2. What formula does the calculator use for a polygon with more than three sides?

For a general polygon, the calculator uses an area‑weighted average method. It first computes the signed area of the polygon, then calculates the centroid coordinates from the vertex coordinates and that area, using the formulas provided in the article.

3. Can the centroid of a polygon lie outside the polygon?

Yes, if the polygon is concave (non‑convex). For convex polygons the centroid always lies inside, but for concave shapes it may fall outside the boundary.

4. What are the limitations on the polygon shapes the calculator accepts?

The polygon must be closed, non‑self‑intersecting, and have at most ten vertices. The vertex order should be consistent (clockwise or counterclockwise).

How to Use

  1. Select the shape type - Triangle or N Points - from the toggle tabs.
  2. Enter the X and Y coordinates for each vertex or point.
  3. Click Calculate Centroid to instantly see the centroid coordinates, formula breakdown, and a visual coordinate plot.