Skip to main content

Center of Gravity Calculator

Calculate the weighted center of gravity (centroid) of a set of point masses. Enter each point as X, Y, Mass (label optional, negative mass for a cutout) — get the total mass, the CG coordinates, a per-point contribution breakdown, and a plotted diagram.

Input

One point per line as "X, Y, Mass", with an optional leading label. X/Y are position coordinates; Mass is the weight (or area/volume, for composite-shape centroids) at that point — any consistent units work. Enter a negative mass for a cutout or void, subtracted from the total.

Output

Center of Gravity Result

Result
MetricValue
No data yet
Diagram

Enter at least one point to see the plotted diagram.

Diagram (SVG source)
 

Per-Point Breakdown

Result
PointXYMass% of Total MassDistance from CG
No data yet
Center of gravity is the mass-weighted average position — exact whether each line is a literal point mass or a component centroid of a larger distributed shape. A negative mass subtracts (a hole/cutout); the total mass must not net to zero. Everything runs in your browser — no coordinates leave your machine.
Was this helpful?

Guides

Find the weighted center of gravity (centroid) of a set of point masses — a bracket assembly, a composite plate with a cutout, or any collection of weighted points on a plane.

How to use it

  1. Enter one point per line as X, Y, Mass, or Label, X, Y, Mass if you want the breakdown table to read like an actual parts list instead of "Point 1, Point 2, …".
  2. X and Y are position coordinates; Mass is the weight (or area/volume, if you're finding the centroid of a distributed shape) at that point. Any consistent units work — the calculator doesn't care whether you're entering millimeters and kilograms or inches and pounds.
  3. For a hole or cutout, enter a negative mass. It subtracts from the total the same way a void subtracts material from a solid shape.

The math

The center of gravity is the mass-weighted average position:

X̄ = Σ(mᵢ·xᵢ) / Σmᵢ · Ȳ = Σ(mᵢ·yᵢ) / Σmᵢ

This is exact whether each line is a literal point mass or the centroid of a larger component — first moments (mass × distance) combine linearly regardless of a component's own shape or extent. That's also why splitting a distributed shape into known sub-component centroids and entering each one's mass or area as the weight (the standard "negative-area method" for composite shapes) gives the right combined centroid.

What you get back

  • Total mass, the point count, and the CG coordinates.
  • A per-point breakdown: each point's percentage share of the total mass and its distance from the computed CG — not just the final answer.
  • A plotted diagram: every point on an SVG scatter plot, sized by its relative mass, with cutouts (negative mass) shown dashed in amber and the CG marked with a crosshair.

Cutouts and zero net mass

A negative-mass point is treated as a void — its position still pulls the CG away from the solid material, just in the opposite direction. If the total mass nets to exactly zero (a cutout that exactly cancels the surrounding mass), the center of gravity is mathematically undefined and the calculator flags it instead of dividing by zero.

Limits

This computes the centroid (first moment) correctly for any combination of point masses or component centroids. It does not compute a moment of inertia — that would need each component's own local rotational inertia added in via the parallel-axis theorem, which a plain point-mass/centroid list doesn't carry. If you need that, treat this as the first step (finding where the combined CG sits) before a separate moment-of-inertia calculation.

Privacy

Everything runs in your browser — no coordinates or masses leave your machine.

Related tools

For the weight of a metal plate itself, see the Plate Weight Calculator. For tolerance analysis across a chain of dimensions, see the Tolerance Stackup Calculator.

centroid calculatorcenter of massweighted centroidcenter of gravitypoint massescg calculatorcomposite area centroidmechanicalmanufacturing

Use it from code

From 3 credits per call

REST API

curl -X POST https://api.iotools.cloud/v1/tool/center-of-gravity-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "points": "Bracket, 0, 0, 1\nFlange, 1.2, 0.8, 8\nBoss, 2.4, …"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `center-of-gravity-calculator` tool (Center of Gravity Calculator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.