Gravitational force comparison
Masses of 10 and 20 at a distance of 2 pull 16 times harder than masses of 5 and 10 at a distance of 4: enter two setups and see which attracts more strongly, and by what factor. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Mass 1a
- 10
- Mass 1b
- 20
- Distance 1
- 2
- Mass 2a
- 5
- Mass 2b
- 10
- Distance 2
- 4
- Force ratio
- 16
- Comparison
- configuration_1_stronger
This gravitational force comparison calculator evaluates two systems, each defined by two masses and their center-to-center separation, then reports the ratio of the first force to the second. It applies Newton's inverse-square law without requiring the gravitational constant because that shared factor cancels in the comparison. Use consistent mass units across all four masses and one consistent distance unit across both separations. The result immediately shows which configuration produces the stronger attraction and by what factor.
Describe both configurations consistently
A gravitational interaction always involves two masses and the center-to-center distance between them. Enter those three values for configuration 1, then enter the corresponding three values for configuration 2. The calculator accepts any coherent choice of units because it computes a dimensionless ratio, but like quantities must use the same unit.
You may instead use grams, tonnes, miles, astronomical units, or another convenient unit, provided you do not mix units within a category. Treat distance as a magnitude, not a signed coordinate difference. Both separation values must therefore be greater than zero.
Masses must also be positive finite values, which keeps both gravitational forces physically meaningful and ensures the ratio has a nonzero denominator. The labels ending in 1 belong to the numerator configuration, while those ending in 2 belong to the denominator configuration. This ordering matters when you interpret a result smaller than one.
Understand the ratio and inverse-square law
Newton's law gives the force magnitude as G times the first mass times the second mass, divided by separation distance squared. Dividing the force for configuration 1 by the force for configuration 2 cancels G, leaving a comparison built entirely from the six supplied values. A value of 4 means configuration 1 produces four times the gravitational force of configuration 2, while 0.25 means configuration 1 produces one quarter as much force, or equivalently configuration 2 is four times stronger.
Mass changes are linear: doubling one mass in configuration 1 doubles the ratio if everything else remains fixed. The comparison field restates the direction in words, reducing the chance of accidentally reading F1/F2 as F2/F1. The formula field records the precise convention used for the returned number.
Use the comparison without calculating absolute force
A ratio is often more useful than two force values when the question is about scaling, sensitivity, or choosing between designs. You can compare a laboratory arrangement before and after moving the masses, test how a hypothetical mass change offsets a greater separation, or verify a textbook proportional-reasoning result. Because the universal gravitational constant cancels, the calculation does not depend on a rounded value of G and does not require SI units merely to obtain the comparison.
It also avoids presenting absolute newton values when the supplied units would not support them. The algorithm is deterministic, runs without network access, and returns the same output for the same finite inputs. Zero distance is rejected explicitly: inverse-square force is undefined there, and silently accepting it would produce infinity rather than a useful physical comparison.
Extremely scaled inputs can exceed floating-point range; if that happens, express all masses in a larger shared unit or both distances in a larger shared unit. Such rescaling preserves the ratio while keeping intermediate values numerically manageable.
What you can do with it
Compare orbital scenarios
Measure how changed body masses and orbital separation alter gravitational attraction between two hypothetical systems.
Check inverse-square homework
Verify a proportional calculation without first computing two absolute forces or inserting the gravitational constant.
Explore design sensitivity
See whether a mass increase compensates for a larger separation in a conceptual experiment or engineering estimate.
FAQ
Do I need to use kilograms and meters?
No. Use any units, but use one shared unit for all masses and one shared unit for both distances. The units cancel from the ratio.
Why is the gravitational constant not an input?
Both forces contain the same gravitational constant G, so it cancels when the first force is divided by the second.
How do I read a ratio smaller than one?
It means the first setup pulls more weakly than the second. A ratio of 0.25 says the first setup has one quarter of the force, or, put the other way round, the second one is four times stronger.
What happens to the ratio if I halve the distance?
Halving the first distance multiplies the ratio by four, because gravity weakens with the square of the separation. Doubling the second distance has the same effect, since the second force becomes four times weaker.
Why compare with a ratio instead of two force values?
A ratio answers scaling questions directly: how much stronger one design, position or mass change is than another. Because the gravitational constant cancels, the result also does not depend on a rounded value of it.
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/gravitational-force-ratio \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"mass_1a":5.972e+24,"mass_1b":1000,"distance_1":6371000,"mass_2a":5.972e+24,"mass_2b":1000,"distance_2":12742000}'const res = await fetch("https://api.kit.forhosting.com/mech/gravitational-force-ratio", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"mass_1a": 5.972e+24,
"mass_1b": 1000,
"distance_1": 6371000,
"mass_2a": 5.972e+24,
"mass_2b": 1000,
"distance_2": 12742000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/mech/gravitational-force-ratio",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"mass_1a": 5.972e+24,
"mass_1b": 1000,
"distance_1": 6371000,
"mass_2a": 5.972e+24,
"mass_2b": 1000,
"distance_2": 12742000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/mech/gravitational-force-ratio", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"mass_1a":5.972e+24,"mass_1b":1000,"distance_1":6371000,"mass_2a":5.972e+24,"mass_2b":1000,"distance_2":12742000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"mass_1a":5.972e+24,"mass_1b":1000,"distance_1":6371000,"mass_2a":5.972e+24,"mass_2b":1000,"distance_2":12742000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/mech/gravitational-force-ratio", 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_1a": 5.972e+24,
"mass_1b": 1000,
"distance_1": 6371000,
"mass_2a": 5.972e+24,
"mass_2b": 1000,
"distance_2": 12742000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "mech.gravitational_force_ratio",
"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
Describe both configurations consistently
If the first mass is entered in kilograms, all four masses must be in kilograms; if distance_1 is in meters, distance_2 must also be in meters.
Understand the ratio and inverse-square law
A force_ratio of 1 means the attractions are equal. Distance changes are quadratic: halving distance_1 multiplies the ratio by four, and doubling distance_2 also multiplies it by four because the second force becomes four times weaker.
Technical questions
What exactly does force_ratio mean?
It is gravitational force 1 divided by gravitational force 2. Values above 1 favor configuration 1; values below 1 favor configuration 2.
What happens if a distance is zero?
The request returns an invalid_input error because inverse-square gravitational force divides by distance squared and is undefined at zero separation.
How much does an API calculation cost?
Each API request costs $0.002. The same deterministic calculation is also available free in the browser.