Omni Calculator logo

With this centroid calculator, we're giving you a hand at finding the centroid of many 2D shapes, as well as of a set of points. In just a few clicks and several numbers inputted, you can find the centroid of a rectangle, triangle, trapezoid, kite, or any other shape imaginable — the only restrictions are that the polygon should be closed, non-self-intersecting, and consist of a maximum of ten vertices. Also, if you're searching for a simple centroid definition, or formulas explaining how to find the centroid, you won't be disappointed — we have it all.

What is centroid?

A centroid, also called a geometric center, is the center of mass of an object of uniform density. To make it easier to understand, you can imagine it as the point on which you should position the tip of a pin to have your geometric figure balanced on it.

Triangle and hexagon balancing on the fingertip. Visual representation of a centroid.

We now know the centroid definition, so let's discuss how to localize it. In the following section, we show you the centroid formula.

What is the formula for the centroid?

In general, a centroid is the arithmetic mean of all the points in the shape. The x- and y-coordinate of the centroid read

Gₓ = (x₁ + x₂ + x₃ + ... + xk) / k

Gᵧ = (y₁ + y₂ + y₃ +... + yk) / k

where (x₁,y₁), ..., (xk,yk) are the vertices of our shape.

For convex shapes, the centroid lays inside the object; for concave ones, the centroid can lay outside (e.g., in a ring-shaped object).

Finding the centroid of a triangle or a set of points is an easy task – the formula is really intuitive. However, if you're searching for the centroid of a polygon – like a rectangle, a trapezoid, a rhombus, a parallelogram, an irregular quadrilateral shape, or another polygon- it is, unfortunately, a bit more complicated.

What is the centroid formula for a triangle?

To find the centroid of a triangle ABC, you need to find the average of vertex coordinates. So if A = (X₁,Y₁), B = (X₂,Y₂), C = (X₃,Y₃), the centroid formula is:

G = [ (X₁ + X₂ + X₃)/3 , (Y₁ + Y₂ + Y₃)/3 ]

If you don't want to do it by hand, just use our centroid calculator! 🙂

Centroid of a triangle in a coordinate system.

🙋 In a triangle, the centroid is the point at which all three medians intersect. That means it's one of a triangle's points of concurrency. Also, a centroid divides each median in a 2:1 ratio (the bigger part is closer to the vertex).

For special triangles, you can find the centroid quite easily:

  1. Centroid of an equilateral triangle

    If you know the side length, a, you can find the centroid of an equilateral triangle:

    G = (a/2, a√3/6)

    (you can determine the value of a with our equilateral triangle calculator)

  2. Centroid of an isosceles triangle

    If your isosceles triangle has legs of length l and height h, then the centroid is described as:

    G = (l/2, h/3)

    (if you don't know the leg length l or the height h, you can find them with our isosceles triangle calculator)

  3. Centroid of a right triangle

    For a right triangle, if you're given the two legs, b and h, you can find the right centroid formula straight away:

    G = (b/3, h/3)

    (the right triangle calculator can help you to find the legs of this type of triangle)

Sometimes people wonder what the midpoint of a triangle is — but hey, there's no such thing! The midpoint is a term tied to a line segment. It's the middle point of a line segment and therefore does not apply to 2D shapes.

However, you can say that the midpoint of a segment is both the centroid of the segment and the centroid of the segment's endpoints.

You can check it in this centroid calculator: choose the N-points option from the drop-down list, enter 2 points, and input some random coordinates. The result should be equal to the outcome from the midpoint calculator.

(Keep in mind that calculations won't work if you use the second option, the N-sided polygon. Why? That's because that formula uses the shape area, and a line segment doesn't have one).

Centroid of a set of points

To find the centroid of a set of k points, you need to calculate the average of their coordinates:

Gₓ = (x₁ + x₂ + x₃ +... + xk) / k

Gᵧ = (y₁ + y₂ + y₃ +... + yk) / k

And that's it! Did you notice that it's the general formula we presented before?

Four points in the coordinate system, with coordinates and centroid marked.

Calculating the centroid of a set of points is used in many different real-life applications, e.g., in data analysis. The most popular method is K-means clustering, where an algorithm tries to minimize the squared distance between the data points and the cluster's centroids.

Centroid of a polygon (centroid of a trapezoid, centroid of a rectangle, and others)

To calculate a polygon's centroid, G(Cx, Cy), which is defined by its n vertices (x0,y), (x1,y1), ..., (xn-1,yn-1), all you need to do is to use these following three formulas:

Cx=16Ai=0n1(xi+xi+1)(xiyi+1xi+1yi)\scriptsize C_x=\frac{1}{6A}\sum_{i=0}^{n-1}(x_i+x_{i+1})(x_iy_{i+1}-x_{i+1}y_i)
Cy=16Ai=0n1(yi+yi+1)(xiyi+1xi+1yi)\scriptsize C_y=\frac{1}{6A}\sum_{i=0}^{n-1}(y_i+y_{i+1})(x_iy_{i+1}-x_{i+1}y_i)

where A is a polygon's signed area:

A=121=0n1(xiyi+1xi+1yi)A = \frac{1}{2}\sum_{1=0}^{n-1}(x_iy_{i+1}-x_{i+1}y_i)

Remember that the vertices should be inputted in order, and the polygon should be closed — meaning that the vertex (x0, y0) is the same as the vertex (xn, yn).

If that centroid formula scares you a bit, wait no further — use this centroid calculator, as we've implemented that equation for you.

Trapezoid in the coordinate system, with vertices and centroid marked.

Even though you can find many different formulas for a centroid of a trapezoid on the Internet, the equations presented above are universal — you don't need to have the origin coinciding with one vertex, nor the trapezoid base in line with the x-axis. Here, you can find the centroid position by knowing just the vertices. The same applies to the centroid of a rectangle, rhombus, parallelogram, pentagon, or any other closed, non-self-intersecting polygon.

Centroid calculator

To use this centroid calculator, simply input the vertices of your shape as Cartesian coordinates. Let's check how to find the centroid of a trapezoid:

  1. Choose the type of shape for which you want to calculate the centroid. In our case, we will choose an N-sided polygon.

  2. Enter the parameter for N (if required). For our example, we need to input the number of sides of our polygon. As the trapezoid is, of course, the quadrilateral, we type 4 into the N box.

Trapezoid from the example, with vertices and centroid marked.
  1. The fields for inputting coordinates will then appear. Enter the coordinates of the vertices of your shape. Let's assume our trapezoid vertices are:
    • A = (1,1)
    • B = (2,4)
    • C = (5,4)
    • D = (11,1)
  2. Our centroid calculator will then display the answer! The centroid of the trapezoid of our choice is (4.974, 2.231).


How do I construct the centroid in a triangle?

Recall the centroid is the point at which the medians intersect. Hence, to construct the centroid in a given triangle:

  1. Construct the perpendicular bisectors of any two sides to find their midpoints.
  2. Draw the medians: connect the midpoints with the opposite vertices.
  3. The intersection point of these medians is the centroid of your triangle. Congrats!

How do I compute the centroid in a polygon?

Here's how you can quickly determine the centroid of a polygon:

  1. Write down the coordinates of each polygon vertex.
  2. Count the vertices and denote their number by n.
  3. Add all the x values from the vertices and divide the sum by n.
  4. Add all the y values from the vertices and divide the sum by n.
  5. That's it! The result from Step 3 is the x-coordinate of the centroid. The result from Step 4 is the y-coordinate of the centroid.

What is the centroid of a (0,0), (0,3), (3,3) triangle?

Recall the coordinates of the centroid are the averages of vertex coordinates. So for the given vertices, we have:

G = [(0 + 0 + 3)/3, (0 + 3 + 3)/3] = [1,2]

Hanna Pamuła, PhD

Point 1
Point 2
Point 3
Check out 23 similar 2d geometry calculators 📏
AreaArea of a rectangleArea of crescent… 20 more
People also viewed…

Catenary curve

Discover the math behind a hanging rope with our catenary curve calculator.

Plastic footprint

Find out how much plastic you use throughout the year with this plastic footprint calculator. Rethink your habits, reduce your plastic waste, and make your life a little greener.

Sine cosine tangent

Discover sine, cosine, and tangent, and calculate them with our handy tool.


The perfect snowman calculator uses math & science rules to help you design the snowman of your dreams!