Mutual gravitational acceleration calculator
Two bodies feel the same gravitational pull, but the lighter one accelerates more: enter the Earth, the Moon and 384,400,000 m between their centres to see each acceleration, their combined approach and the force. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Mass1
- 5,972,200,000,000,000,000,000,000
- Mass2
- 73,420,000,000,000,000,000,000
- Distance
- 384,400,000
- G
- 0.0000000001
- R squared
- 147,763,360,000,000,000
- Acceleration1
- 0.000033163
- Acceleration2
- 0.0026975736
Every pair of masses accelerates toward each other under Newton's law of universal gravitation. The force on each body is the same magnitude, but the accelerations differ: the lighter body accelerates more. With SI masses m1 and m2 in kilograms and centre-to-centre separation r in metres, the closed forms are a1 equals G times m2 over r squared for the first body and a2 equals G times m1 over r squared for the second, where G is the gravitational constant. The relative acceleration of approach along the line of centres is simply a1 plus a2.
How mutual gravitational acceleration works
Start from Newton's law of universal gravitation: the attractive force between two point masses has magnitude F equals G times m1 times m2 divided by r squared and acts along the line joining the centres. Newton's second law then gives the acceleration each mass experiences: a1 equals F divided by m1, which simplifies to G times m2 over r squared, and a2 equals F divided by m2, which simplifies to G times m1 over r squared.
The lighter mass therefore feels the larger acceleration, while the force magnitude is the same on both by Newton's third law. The constant G is fixed here at the CODATA two thousand eighteen value of six point six seven four three times ten to the minus eleven cubic metres per kilogram per second squared, so identical SI inputs always produce identical acceleration numbers. Doubling the separation quarters each acceleration; doubling one mass doubles only the acceleration of the other body.
For perfect spheres or spherical shells of uniform density the exterior field is identical to a point mass at the centre, which is why textbook Earth–Moon and binary-star checks use total mass and mean centre-to-centre distance. The calculator evaluates the closed forms in deterministic floating-point arithmetic: no random seeds, no wall-clock timestamps, no network calls, and no model drift. Distance r must be a finite strictly positive number of metres; zero fails with invalid input because both formulas divide by r squared and the accelerations are undefined at coincident centres.
Negative separation is rejected as non-physical for a centre-to-centre distance. Each mass must likewise be finite and positive so the products stay non-negative and the accelerations are well-defined attractions. This page intentionally focuses on mutual acceleration magnitudes; standalone force landings, single-body field strength, orbital periods, and general-relativistic corrections are separate search intents and separate tools.
What you send and what you get back
Send three required finite numbers under the fields mass1, mass2, and distance. Mass1 and mass2 are the two body masses in kilograms and must each be strictly greater than zero; for Earth use about five point nine seven two times ten to the twenty-four kilograms, for the Moon about seven point three four two times ten to the twenty-two kilograms, and for a laboratory test mass a few kilograms is typical.
Distance is the centre-to-centre separation r in metres and must also be strictly greater than zero; for the mean Earth–Moon distance use about three hundred eighty-four million four hundred thousand metres. Classic textbook checks include two one-kilogram masses one metre apart recovering accelerations equal to G on each body, and Earth–Moon at mean separation recovering a tiny acceleration on Earth and a larger one on the Moon.
Keep units consistent: convert grams, tonnes, kilometres, and astronomical units to kilograms and metres before calling so the numeric product matches the SI interpretation your report claims.
Where mutual gravitational acceleration shows up in real work
Secondary-school and introductory university physics and astronomy courses assign two-body acceleration drills, Earth–Moon attraction checks, and inverse-square rearrangements that need both a1 and a2, not only the force magnitude; a single trusted oracle speeds grading and demo setup. Planetary science and mission concept teams convert tabulated masses and separations into pairwise accelerations before full gravity-field models and numerical propagators. Science communicators convert human-scale masses at laboratory distances into tiny accelerations to illustrate how weak gravity is compared with electromagnetism and how the lighter partner always accelerates more.
Game and simulation authors seed n-body toy demos with closed-form pairwise accelerations when they want a transparent ground truth without floating-point surprises from ad-hoc constants. If you later need gravitational force as the primary landing, single-source field strength g equals G M over r squared, orbital period from semi-major axis, tidal gradients, or general-relativistic geodesics, treat those as separate search intents and landings rather than overloading this mutual gravitational acceleration calculator page.
What you can do with it
Homework and exam answer keys
Compute a1 and a2 from two masses and separation so students and auto-graders share one closed-form ground truth in m/s² with relative acceleration and force for audit.
Earth–Moon and binary checks
Combine planetary or stellar masses with centre-to-centre distance to recover how much each body accelerates toward the other under Newtonian gravity.
FAQ
What formula does this mutual gravitational acceleration calculator use?
a1 = G·m2/r² for the acceleration of mass1 toward mass2, and a2 = G·m1/r² for the acceleration of mass2 toward mass1, with G fixed at the CODATA 2018 value. Relative acceleration is a1 + a2 = G·(m1+m2)/r².
What happens if distance is zero?
Both acceleration formulas divide by r², so zero separation is undefined and is rejected with a clear validation message instead of returning Infinity or NaN.
What units should I use?
SI: masses in kilograms and distance in metres. Accelerations are returned in metres per second squared (m/s²). Convert grams, tonnes, kilometres, and AU yourself before calling.
Why is acceleration1 not equal to acceleration2?
The force magnitude is the same on both masses, but a = F/m, so the lighter mass accelerates more. Only equal masses produce equal mutual accelerations.
What does it cost?
The browser tool is free and runs locally.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/mech/mutual-gravitational-acceleration \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"mass1":5.9722e+24,"mass2":7.342e+22,"distance":384400000}'const res = await fetch("https://api.kit.forhosting.com/mech/mutual-gravitational-acceleration", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"mass1": 5.9722e+24,
"mass2": 7.342e+22,
"distance": 384400000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/mech/mutual-gravitational-acceleration",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"mass1": 5.9722e+24,
"mass2": 7.342e+22,
"distance": 384400000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/mech/mutual-gravitational-acceleration", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"mass1":5.9722e+24,"mass2":7.342e+22,"distance":384400000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"mass1":5.9722e+24,"mass2":7.342e+22,"distance":384400000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/mech/mutual-gravitational-acceleration", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"mass1": 5.9722e+24,
"mass2": 7.342e+22,
"distance": 384400000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "mech.mutual_gravitational_acceleration",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What you send and what you get back
Missing fields, non-numeric strings, NaN, Infinity, non-positive masses, zero distance, and negative distance fail with invalid_input and are not charged. On success the response echoes cleaned mass1, mass2, and distance, exposes G as the fixed CODATA constant, r_squared as distance squared, acceleration1 as G times mass2 over r squared, acceleration2 as G times mass1 over r squared, relative_acceleration as the sum of the two accelerations, force as the common attraction magnitude in newtons, includes a units hint object, sets method to mutual_gravitational_acceleration, and formula to a1 equals G times m2 over r squared comma a2 equals G times m1 over r squared comma a_rel equals G times m1 plus m2 over r squared. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.
Where mutual gravitational acceleration shows up in real work
Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.
Integration use cases
Lab demos and simulation seeds
Turn laboratory or toy n-body masses and distances into pairwise accelerations for classroom widgets, exhibits, and deterministic simulation fixtures.