Center of Mass Calculator – Centroid, Balance and Barycenter
The center of massis the single point at which a system's entire mass can be treated as concentrated for the purposes of translational motion. Push a wrench across a table and it tumbles in a complicated way, but one point of it travels in a clean straight line — that point is the center of mass. This center of mass calculator locates it for point-mass systems in one, two or three dimensions, for composite shapes with holes cut out of them, for two-body barycenters, and for balance problems where you know the pivot and need the missing mass.
The formula, one axis at a time
Every mode rests on the same weighted average, applied independently to each axis:
x_cm = Σ(mᵢ · xᵢ) / Σmᵢ
A two-dimensional problem is therefore just two one-dimensional problems that happen to share a denominator. For masses of 1 kg at (0, 0), 2 kg at (4, 0) and 3 kg at (2, 6), the total mass is 6 kg, the first moments are Σmx = 14 and Σmy = 18 kg·m, and the center of mass sits at (2.333, 3.000) m. Notice that the answer is pulled toward the 3 kg mass — the weighting is what separates a center of mass from a plain geometric centroid.
First moments and why they vanish
The numerators Σmx, Σmy and Σmz are called first moments, and they are worth looking at directly. Measure positions from the center of mass instead of from the origin and every first moment becomes exactly zero. That is the defining property of the point: it is the location about which the mass-weighted displacements cancel. The contribution breakdown in the tool shows each object's share of the total first moment, which makes it obvious at a glance when one heavy object is dominating the result.
Holes count as negative mass
When a body has uniform density, mass is proportional to area or volume, so areas can serve directly as weights. Removing material is then arithmetically identical to adding a region of negativearea at the hole's own centroid. A 10 × 10 cm plate with a 2 cm-radius hole centred at (7, 5) has a net area of 87.434 cm² and a center of mass at x = 4.713 cm — displaced away from the hole, exactly as intuition demands.
Barycenters and balance problems
For two bodies separated by a distance d, the common center of mass lies at r₁ = d · m₂ / (m₁ + m₂)from the first body's centre. The Earth–Moon barycenter works out at about 4,668 km from Earth's centre, which is less than Earth's 6,371 km mean radius — so the Earth does not orbit a point in empty space, it wobbles about a point buried inside itself. The balance mode inverts the same formula: given a fulcrum position and every mass but one, it solves for the unknown mass or the unknown position that puts the system in equilibrium.
From center of mass to moment of inertia
The center of mass is also the gateway to rotational dynamics. Compute I_cm = Σmᵢdᵢ² about an axis through it, then shift to any parallel axis with the parallel-axis theorem, I = I_cm + Md². For the three-particle system above this gives 65.333 + 6 × 14.444 = 152.000 kg·m² about the origin, which matches the direct sum Σmᵢrᵢ² exactly. If your hand check disagrees slightly, the usual culprit is squaring a rounded distance instead of carrying d² unrounded.