Acceleration due to gravity calculator
At 10 km, around a long-haul cruising altitude, gravity is about 0.3 % weaker than the standard 9.80665 m/s² at sea level. Enter an altitude in metres and get the local gravitational acceleration from the inverse-square law. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Altitude
- 10,000
- G
- 9.775937053 m/s²
- G0
- 9.80665
- Earth radius
- 6,371,000
- Precision
- 10
Send an altitude in metres and get back the gravitational acceleration in metres per second squared, computed with the inverse-square law from standard gravity and the mean Earth radius. It is the same formula textbooks teach, packaged as a deterministic call you can drop into a simulation, a lesson plan, or a sanity check — no ephemeris files, no lookup tables, no approximation drift between runs.
Why gravity changes with altitude
Newton's law of universal gravitation says the pull between two masses weakens with the square of the distance between their centres. Standing on the ground you are already one Earth radius from the centre, so climbing a few kilometres barely moves the needle — but the effect is real and measurable.
At cruising altitude of a long-haul flight, around ten kilometres up, gravity is about 0.3 percent weaker than at sea level; at the orbit of the International Space Station, roughly four hundred kilometres up, it is down by nearly nine percent, which is why 'weightlessness' in orbit is really free fall, not the absence of gravity. The acceleration due to gravity calculator applies exactly that relationship: it scales standard surface gravity by the square of the ratio between Earth's radius and your distance from the centre.
Because the formula is a pure function of altitude, the same input always yields the same output, which makes the result safe to cache, compare, and assert against in tests.
How the number is computed
The engine takes your altitude in metres, adds it to the mean Earth radius of 6,371 kilometres to get your distance from the centre of the planet, then divides that radius by the total distance and squares the ratio. Multiplying by standard gravity, 9.80665 metres per second squared, gives the local gravitational acceleration. An altitude of zero returns standard gravity exactly, which is a convenient built-in check.
Where it fits in real work
Physics teachers use it to show students that g is not a universal constant but a field that fades with height. Aerospace and drone software uses it to keep weight and thrust budgets honest at operating altitude. Game and simulation developers use it when a projectile or lander needs plausible physics on a high peak or a balloon platform.
Data pipelines use it as a quick validator: if a sensor claims an altitude, the expected gravity is one call away.
What you can do with it
Correct physics at flight altitude
Feed the local g into drone, balloon, or aircraft simulations instead of assuming the sea-level value everywhere.
Teach the inverse-square law
Show students exactly how gravity fades from sea level to orbit with one reproducible formula and no hand-waving.
Sanity-check altitude data
Compare a sensor's reported altitude against the expected gravitational acceleration to catch unit and sign errors early.
FAQ
Why is a negative altitude rejected?
Because the inverse-square law describes the field outside a spherical Earth.
What unit does the result use?
Metres per second squared (m/s²), the SI unit of acceleration, when the altitude is given in metres.
Does it account for latitude or Earth's rotation?
No. It models a spherical, non-rotating Earth. Centrifugal and ellipsoidal corrections are intentionally out of scope to keep the result a pure function of altitude.
Is the result deterministic?
Yes. There is no network, clock, or randomness involved, and the output is rounded to a fixed precision, so identical inputs always produce identical outputs.
Is there still gravity at the height of the International Space Station?
Yes. Roughly 400 km up, gravity is down by nearly 9 % compared with sea level. The weightlessness astronauts feel in orbit comes from falling continuously around the Earth, not from the absence of gravity.
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/phys/acceleration-due-to-gravity \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"altitude":10000}'const res = await fetch("https://api.kit.forhosting.com/phys/acceleration-due-to-gravity", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"altitude": 10000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/phys/acceleration-due-to-gravity",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"altitude": 10000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/phys/acceleration-due-to-gravity", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"altitude":10000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"altitude":10000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/phys/acceleration-due-to-gravity", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"altitude": 10000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "phys.acceleration_due_to_gravity",
"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.
Limits
max_abs_altitude | 1000000000000000 |
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
The acceleration due to gravity API answers one clean question: how strong is Earth's pull once you leave the surface?
How the number is computed
The input must be a finite, non-negative number: a negative altitude would mean modelling the interior of the Earth, where the inverse-square law for the exterior no longer applies, so the calculator rejects it with a clear invalid_input error instead of returning a confident-looking but wrong number.
Where it fits in real work
The same code that runs on our edge runs free in your browser on this page, so you can explore values interactively and only pay $0.002 per request when you automate the call. There is no network lookup, no clock, and no randomness involved — the formula, two published constants, and your input are the whole story, which keeps the call fast, cheap, and trivially reproducible in any environment.
Technical questions
What does it cost?
$0.002 per request. It is also free to run in your browser on this page.
Which formula does it use?
The inverse-square law: g = g0 · (R / (R + h))², with standard gravity g0 = 9.80665 m/s² and mean Earth radius R = 6.371e6 m.