Gravity balance point distance calculator between two masses
This gravity balance point calculator finds the position on the straight line between two masses where their Newtonian gravitational accelerations have equal magnitude and opposite direction.
Run — free
Enter both positive masses in the same unit and their center-to-center separation in any distance unit. The result reports the distance from each mass and the fractional position along the separation. It is a direct analytic calculation for two isolated point masses, useful for quick astronomy, physics, and engineering estimates without iteration.
Enter two masses and one center-to-center separation
Provide mass_1 and mass_2 as positive finite numbers expressed in the same mass unit. Kilograms are conventional, but the balance position depends only on their ratio, so grams, solar masses, Earth masses, or another consistent unit produce the same fractional answer. Enter separation as the distance between the two mass centers. The returned distances use that same distance unit: a separation supplied in metres gives metre results, while kilometres give kilometre results. All three values must be greater than zero. A zero or negative mass has no valid meaning for this calculator and is rejected instead of producing a misleading endpoint. A zero or negative separation is also rejected because there would be no open interval between distinct centers. Scientific notation is suitable for astronomical values when sending JSON, such as 5.972e24 for Earth mass. The first and second labels establish direction only; swapping the masses swaps the corresponding distances while leaving the physical location consistent.
Understand the force-balance equation
At a position x measured from the first mass, Newtonian gravitational acceleration toward that mass is proportional to mass_1 divided by x squared. Acceleration toward the second mass is proportional to mass_2 divided by the remaining distance, separation minus x, squared. Setting those magnitudes equal cancels the universal gravitational constant and leads to the closed-form expression x = separation × sqrt(mass_1) / (sqrt(mass_1) + sqrt(mass_2)). That is why no value for G is requested and why consistent mass units are enough. The response includes distance_from_mass_1, distance_from_mass_2, and fraction_from_mass_1. The two distances add to the original separation. Equal masses put the point exactly halfway between them. If the first mass is larger, the balance point lies farther from it and closer to the second mass, because more distance is needed to weaken its stronger pull. This calculation compares gravitational acceleration on an ideal test particle and does not depend on that particle's own mass.
Use the result within the model's limits
Treat this result as the simple gravitational cancellation point for two stationary, isolated point masses on the line joining their centers. It is valuable for classroom problems, sanity checks, rough mission-planning estimates, binary-system intuition, and determining where an ideal test particle would experience equal opposing Newtonian attractions at an instant. It is not the rotating-frame L1 Lagrange point used in orbital mechanics. A true L1 calculation also includes the frame's centrifugal effect and the orbital angular speed, so its position differs from the force-only balance point returned here. The model likewise ignores other bodies, non-spherical mass distributions, atmosphere, radiation pressure, relativity, and motion of the test particle. Confirm that the computed point lies outside the physical radii of both bodies if you intend to interpret it as a location in free space; this calculator receives masses and separation only, not radii. For automated use, the API price is $0.002 per request, while the same deterministic arithmetic can run in the browser without sending the input elsewhere.
What you can do with it
Compare a planet and moon
Estimate the force-only cancellation location along the line between a planet and its moon from their masses and separation.
Check a physics exercise
Verify an analytic solution and see both endpoint distances without manually rearranging the inverse-square equation.
Explore mass-ratio intuition
Change either mass to see how the square root of the mass ratio shifts the balance point toward the smaller body.
FAQ
What does the calculator cost?
The API costs $0.002 per request, and the browser version is free to run.
Which units should I use?
Use the same unit for both masses. The output distances use the same unit as the supplied separation.
Why must both masses be positive?
The stated two-body gravitational balance model requires two attracting positive masses; zero or negative values do not define the requested interior balance point.
Is this the L1 Lagrange point?
No. This is the point where the two Newtonian gravitational pulls alone cancel. Orbital L1 also accounts for the rotating frame and centrifugal effect.
Where is the point for equal masses?
It is halfway between them, so each returned distance equals half the separation.
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/astro/l1-gravity-balance \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"mass_1":5.972e+24,"mass_2":7.342e+22,"separation":384400000}'const res = await fetch("https://api.kit.forhosting.com/astro/l1-gravity-balance", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"mass_1": 5.972e+24,
"mass_2": 7.342e+22,
"separation": 384400000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/astro/l1-gravity-balance",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"mass_1": 5.972e+24,
"mass_2": 7.342e+22,
"separation": 384400000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/astro/l1-gravity-balance", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"mass_1":5.972e+24,"mass_2":7.342e+22,"separation":384400000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"mass_1":5.972e+24,"mass_2":7.342e+22,"separation":384400000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/astro/l1-gravity-balance", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"mass_1": 5.972e+24,
"mass_2": 7.342e+22,
"separation": 384400000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "astro.l1_gravity_balance",
"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. |