Center of mass calculator
Type the masses with their positions, one bracket per point – (m, x) on a line, (m, x, y) in a plane or (m, x, y, z) in space. The calculator weights every coordinate by its mass and gives the center of mass and the total mass. Any consistent units work.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Write each point as its mass followed by its coordinates in brackets: (m, x) for a line, (m, x, y) for a plane, (m, x, y, z) for space.
- Separate points with commas or put each on its own line.
- Read the center of mass, each coordinate and the total mass.
- Total mass: M = Σ mᵢ
- Center of mass: x̄ = Σ mᵢ xᵢ ÷ M, ȳ = Σ mᵢ yᵢ ÷ M, z̄ = Σ mᵢ zᵢ ÷ M
Worked example
Three masses in a plane: 2 kg at (0, 0), 3 kg at (4, 0) and 5 kg at (1, 3). M = 2 + 3 + 5 = 10 kg.
- x̄ = (2 × 0 + 3 × 4 + 5 × 1) ÷ 10 = 17 ÷ 10 = 1.7
- ȳ = (2 × 0 + 3 × 0 + 5 × 3) ÷ 10 = 15 ÷ 10 = 1.5
The center of mass is at (1.7, 1.5), the input as typed: (2, 0, 0), (3, 4, 0), (5, 1, 3).
Tips
- Put the origin somewhere handy, for example at one of the masses: zeros simplify the check by hand.
- Negative coordinates are fine; masses must be positive.
- Two equal masses have their center of mass exactly halfway between them – a quick sanity check.
Frequently asked questions
How do you calculate the center of mass?
Multiply each coordinate by its mass, add them up and divide by the total mass – x̄ = Σ mᵢ xᵢ ÷ Σ mᵢ, and the same for y and z. Masses of 2, 3 and 5 at (0, 0), (4, 0) and (1, 3) give (1.7, 1.5).
Which units should I use?
Any, as long as they are the same for all points. Masses in kg or g give the same center; coordinates in cm give the answer in cm.
Can the center of mass lie outside the objects?
Yes. A ring or a boomerang has its center of mass in the empty middle. For point masses it always lies inside the region the points span.
How do I find the center of mass of a real shape?
Split it into simple parts, use each part's own centre (the middle of a rectangle, for example) as a point with that part's mass, and enter those points.