acalculator

Where is the centroid?

Type the vertices of a triangle, a set of points with optional masses, or the corners of a polygon. The centroid calculator finds the balance point (x̄, ȳ) and shows the sums behind it.

Your numbers

Find the centroid of
Points
Row 1
Row 2
Row 3
Centroid
(2, 1)

The centroid is at (2, 1).

x̄
2
ȳ
1
Working
total mass m = 3; Σmx = 6; x̄ = 6 ÷ 3 = 2; Σmy = 3; ȳ = 3 ÷ 3 = 1

Centroid: (2, 1). The centroid is at (2, 1).

How it is worked out

How to calculate

Finds the centroid of a triangle or any set of points (with optional masses), or the centroid of a polygon’s area from its vertices, with the working.

Example with the default inputs (Find the centroid of Triangle or points, Points [x 0, y 0; x 6, y 0; x 0, y 3]): The centroid is at (2, 1).

Method: Points: x̄ = Σmx ÷ Σm, ȳ = Σmy ÷ Σm (m = 1 when no mass is typed). Polygon: A = ½Σ(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ), x̄ = Σ(xᵢ + xᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ) ÷ 6A, ȳ = Σ(yᵢ + yᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ) ÷ 6A.

  • A triangle’s centroid is the same as the centroid of its three vertices with equal masses.
  • Polygon vertices are typed in order around the outline (either direction), and the outline does not cross itself.
  • Typed decimals are read exactly; each result is rounded once.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Find the centroid of Triangle or points, Points -1 3 2; 1 1 6; 2 -2 4 gives Centroid (1, 0.3333333333), x̄ 1, ȳ 0.333333.Source: OpenStax, Calculus Volume 2, §2.6 Moments and Centers of Mass (x̄ = My ÷ m, ȳ = Mx ÷ m for point masses; Example 2.30: 2 kg at (−1, 3), 6 kg at (1, 1) and 4 kg at (2, −2) balance at (1, 1/3)), https://openstax.org/books/calculus-volume-2/pages/2-6-moments-and-centers-of-mass (retrieved 2026-10-05)
  2. Find the centroid of Triangle or points, Points 0 0; 6 0; 0 3 gives Centroid (2, 1).Source: OpenStax, Calculus Volume 2, §2.6 Moments and Centers of Mass (x̄ = My ÷ m, ȳ = Mx ÷ m for point masses; Example 2.30: 2 kg at (−1, 3), 6 kg at (1, 1) and 4 kg at (2, −2) balance at (1, 1/3)), https://openstax.org/books/calculus-volume-2/pages/2-6-moments-and-centers-of-mass (retrieved 2026-10-05)
  3. Find the centroid of Polygon area, Points 0 0; 6 0; 0 3 gives Centroid (2, 1), Polygon area 9.Source: Wikipedia, Centroid, section "Of a polygon" (the shoelace area and Cx = (1 ÷ 6A)Σ(xᵢ + xᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ)), https://en.wikipedia.org/wiki/Centroid#Of_a_polygon (retrieved 2026-10-05)
  4. Find the centroid of Polygon area, Points 0 0; 4 0; 4 1; 1 1; 1 3; 0 3 gives Centroid (1.5, 1), x̄ 1.5, ȳ 1, Polygon area 6.Source: Wikipedia, Centroid, section "Of a polygon" (the shoelace area and Cx = (1 ÷ 6A)Σ(xᵢ + xᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ)), https://en.wikipedia.org/wiki/Centroid#Of_a_polygon (retrieved 2026-10-05)

How it works

Triangle or points. Each point (xᵢ, yᵢ) has a mass mᵢ, which is 1 when its box is left empty. The centroid is

  • x̄ = Σmᵢxᵢ ÷ Σmᵢ
  • ȳ = Σmᵢyᵢ ÷ Σmᵢ

With equal masses this is the average of the points. For a triangle, the average of the three vertices is also the centroid of its area, where the medians meet.

Polygon area. For vertices (x₁, y₁) … (xₙ, yₙ) in order around the outline, with (xₙ₊₁, yₙ₊₁) = (x₁, y₁):

  • A = ½Σ(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ) (the shoelace formula; negative when the vertices run clockwise)
  • x̄ = Σ(xᵢ + xᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ) ÷ 6A
  • ȳ = Σ(yᵢ + yᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ) ÷ 6A

The sign of A cancels, so either direction gives the same centroid. The page shows the area as |A|. Masses are ignored for a polygon.

Rules

  • Coordinates are from −10¹² to 10¹²; a mass is more than 0 and at most 10¹².
  • Points: 1 to 20 points. Polygon: 3 to 20 vertices; vertices that enclose no area (all on one line, or an outline whose parts cancel to A = 0) give no answer.
  • The polygon outline should not cross itself; the formula then gives no meaningful centroid.

Output format. Typed decimals are read exactly, so the sums and the division are exact; the centroid is rounded once to 10 significant figures, with the true minus sign (−).

Worked examples by hand

Point masses. m = 2 + 6 + 4 = 12. Σmx = 2(−1) + 6(1) + 4(2) = 12, so x̄ = 12 ÷ 12 = 1. Σmy = 2(3) + 6(1) + 4(−2) = 4, so ȳ = 4 ÷ 12 = 1/3 ≈ 0.3333333333.

Triangle (0, 0), (6, 0), (0, 3) as points. x̄ = (0 + 6 + 0) ÷ 3 = 2, ȳ = (0 + 0 + 3) ÷ 3 = 1.

The same triangle as a polygon. The cross terms are 0 × 0 − 6 × 0 = 0, 6 × 3 − 0 × 0 = 18 and 0 × 0 − 0 × 3 = 0, so 2A = 18 and A = 9. Σ(xᵢ + xᵢ₊₁) × cross = 6 × 0 + 6 × 18 + 0 × 0 = 108, so x̄ = 108 ÷ 54 = 2. Σ(yᵢ + yᵢ₊₁) × cross = 3 × 18 = 54, so ȳ = 54 ÷ 54 = 1.

L shape (0, 0), (4, 0), (4, 1), (1, 1), (1, 3), (0, 3). Split it into a 4 × 1 rectangle (area 4, centre (2, 0.5)) and a 1 × 2 rectangle (area 2, centre (0.5, 2)). A = 6, x̄ = (4 × 2 + 2 × 0.5) ÷ 6 = 1.5, ȳ = (4 × 0.5 + 2 × 2) ÷ 6 = 1. The shoelace sums give the same values.

Other questions people ask

How do I find the centroid of a triangle?

Average the three vertices: x̄ = (x₁ + x₂ + x₃) ÷ 3 and ȳ = (y₁ + y₂ + y₃) ÷ 3. The triangle (0, 0), (6, 0), (0, 3) has its centroid at (2, 1).

Where is the centroid of a triangle on the medians?

The three medians (lines from each vertex to the middle of the opposite side) meet at the centroid. It lies two thirds of the way from each vertex to the middle of the opposite side.

How do I find the center of mass of point masses?

Multiply each coordinate by its mass, add, and divide by the total mass: x̄ = Σmx ÷ Σm and ȳ = Σmy ÷ Σm. Masses of 2, 6 and 4 at (−1, 3), (1, 1) and (2, −2) balance at (1, 1/3).

How do I find the centroid of a polygon?

Type the vertices in order around the outline. The page finds the area with the shoelace formula, A = ½Σ(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ), then x̄ = Σ(xᵢ + xᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ) ÷ 6A and ȳ the same way with y.

Is the centroid of a polygon the average of its vertices?

Only for a triangle (and for shapes with enough symmetry, such as a rectangle). For an L shape with corners (0, 0), (4, 0), (4, 1), (1, 1), (1, 3), (0, 3), the vertex average is (1.67, 1.33), but the area centroid is (1.5, 1).

What is the difference between the centroid and the center of mass?

The centroid is the geometric center of a shape. It equals the center of mass when the shape has the same density everywhere, or when every point has the same mass.