Surface gravity calculator
Get the pull at the surface of any world from its mass and size: 5.972 × 10²⁴ kg and 6371000 m, Earth's values, give 9.8199734262 m/s², ready for weight and falling-object problems. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Mass
- 5,972,000,000,000,000,000,000,000
- Radius
- 6,371,000
- G
- 9.8199734262 m/s²
- G
- 0.0000000001
- Precision
- 10
This surface gravity calculator returns the Newtonian surface gravitational acceleration of a planet, moon, or star from its mass and radius. The closed form is fully deterministic: g equals G times M over R squared, using the CODATA 2018 gravitational constant G equals 6.67430 times ten to the minus eleven cubic metres per kilogram per second squared. With SI inputs — mass in kilograms and radius in metres — the result is in metres per second squared, the same unit students and engineers use for free-fall and weight calculations. A well-known check is Earth-scale mass 5.972 times ten to the twenty-four kilograms and mean radius 6.371 times ten to the six metres, which yields about 9.82 metres per second squared. The engine uses only finite arithmetic with no network calls, no sampling, and no date-dependent shortcuts.
Where surface gravity fits in study, astronomy, and software
Students meet surface gravity when a textbook moves from Newton’s law of universal gravitation to free-fall acceleration on Earth and other worlds, when a contest problem asks for g on a planet of given mass and radius, or when they compare weight and escape conditions without calculus. Teachers can pre-generate answer keys for modest planetary parameters without trusting opaque calculator apps that silently switch units or drop scientific notation.
Developers call the same contract from scripts to seed deterministic test vectors for space-game physics, to normalize user-entered mass and radius before mission-planning demos, or to satisfy programming-challenge statements that demand g rather than a hand-waved Earth value. Contest practice often needs a fast, offline source of surface accelerations so solutions can be checked without graphing calculators under time pressure. Product and education tools use the formula when a learner types planetary mass and radius and the UI must show g in metres per second squared next to weight examples.
What you can do with it
Homework and planetary g checks
Compute surface gravity from textbook mass and radius values and verify g before weight or free-fall problems.
Astronomy and game physics tools
Normalize user-entered mass and radius into surface g for exoplanet comparators, mission demos, and space games.
FAQ
What does the surface gravity calculator cost?
It is free in your browser on this page.
What happens if radius is zero or negative?
Surface gravity g = G·M/R² is undefined for a non-positive radius.
Does this include planetary rotation or oblateness?
No. It returns the pure Newtonian surface field for a spherical body. Rotation, J2, and altitude above the surface are out of scope.
Why are results rounded to a precision?
Default precision is 10 decimal places; you can set precision from 0 to 15.
Can the mass be zero?
Yes. A mass of zero is accepted and simply gives a surface gravity of zero. Only negative masses are rejected, along with a radius that is zero or negative, because the formula divides by the radius squared.
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/astro/surface-gravity \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"mass":5.972e+24,"radius":6371000}'const res = await fetch("https://api.kit.forhosting.com/astro/surface-gravity", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"mass": 5.972e+24,
"radius": 6371000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/astro/surface-gravity",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"mass": 5.972e+24,
"radius": 6371000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/astro/surface-gravity", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"mass":5.972e+24,"radius":6371000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"mass":5.972e+24,"radius":6371000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/astro/surface-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
{
"mass": 5.972e+24,
"radius": 6371000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "astro.surface_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_mass | 1e+40 |
max_abs_radius | 100000000000000000000 |
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 surface gravity means and what the response contains
Surface gravity is the acceleration that a test mass would experience at the exterior surface of a spherical body if only Newtonian gravity acted and the body were non-rotating. For a mass M and radius R the exterior field magnitude is G times M over R squared, so at the surface the acceleration is that value. This calculator returns the normalized mass and radius you supplied, the computed g rounded to the requested precision, the fixed CODATA gravitational constant G used in the product, a unit string m/s², the method tag surface_gravity, the precision used, and a short formula reminder. There is no approximate numerical integrator and no random sampling of multipole moments: the engine either builds exact floating-point g inside the supported magnitude range or rejects the input with invalid_input. Rejected cases include missing mass or radius, non-finite values, magnitudes above the documented ceilings, negative mass, and any radius that is zero or negative, because division by R squared is undefined or non-physical for a surface acceleration in this model.
How mass and radius are read and how g stays reproducible
Optional leading plus signs and scientific notation on numeric strings are allowed when they parse as finite decimals; embedded spaces, hex prefixes, and non-numeric tokens are rejected with a clear message so a bad cell does not become a wrong surface g. Zero mass is valid and simply yields zero surface gravity. The preferred fields are mass for the body mass in kilograms and radius for the mean or equatorial radius in metres, but aliases m, M, and planet_mass for mass, and r, R, and planet_radius for radius are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. Radius must be strictly positive: if radius is zero, negative, or negative zero, the request fails with invalid_input because surface gravity g equals G times M over R squared is undefined for a non-positive radius. An optional precision field, with aliases decimals and dp, chooses how many decimal places to expose for mass, radius, and g, defaulting to ten and capped at fifteen so JSON goldens stay stable. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing the surface-gravity formula yourself.
Where surface gravity fits in study, astronomy, and software
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result. Pair it with potential-energy or weight-force tools when you need related mechanics steps, and with other physics endpoints when you are building a small lab of free, deterministic science helpers.
Integration use cases
Deterministic test fixtures
Generate reproducible g values for unit tests, property checks, and CI assertions on planetary physics modules.
Technical questions
How is surface gravity defined here?
For a spherical body of mass M and radius R, g = G·M/R² with G = 6.67430×10⁻¹¹ m³ kg⁻¹ s⁻² (CODATA 2018). The SI unit is m/s².