Surface gravity from density calculator
A body with a mean density of 5514 kg/m³ and a radius of 6371000 m has a surface gravity of 9.8212937284 m/s², like Earth. Use it when you know density and radius rather than total mass. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Density
- 5,514
- Radius
- 6,371,000
- G
- 9.8212937284 m/s²
- G
- 0.0000000001
- Precision
- 10
This surface gravity from density calculator returns the Newtonian surface gravitational acceleration of a planet, moon, or star when you know mean bulk density and radius rather than total mass. For a uniform sphere the mass is four thirds pi R cubed times density, so surface gravity simplifies to the closed form g equals four thirds pi G rho R, 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 — density in kilograms per cubic metre and radius in metres — the result is in metres per second squared, the same unit used for free-fall and weight work. An Earth-scale check uses density about 5514 kilograms per cubic metre and radius 6.371 times ten to the six metres, which yields roughly nine point eight metres per second squared. The engine uses only finite arithmetic with no network calls, no sampling, and no date-dependent shortcuts.
Where surface gravity from density fits in study, astronomy, and software
Students meet the density form of surface gravity when a textbook starts from bulk density tables rather than total mass, when a contest problem gives mean density and radius for a rocky planet, or when they compare g across bodies whose catalog rows list rho and R. 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 density and radius before mission-planning demos, or to satisfy programming-challenge statements that demand g from density 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 density and radius and the UI must show g in metres per second squared next to weight examples. Pair it with the mass-based surface gravity calculator when you have M instead of rho, and with free-fall or weight tools when you need related mechanics steps in a small lab of free, deterministic science helpers.
What you can do with it
Homework and density-table g checks
Compute surface gravity from textbook bulk density and radius values and verify g before weight or free-fall problems.
Astronomy and game physics tools
Normalize user-entered density and radius into surface g for exoplanet comparators, mission demos, and space games.
FAQ
What does the surface gravity from density calculator cost?
It is free in your browser on this page.
What happens if radius is negative?
Surface gravity g = (4/3)πGρR is undefined for a negative radius.
When should I use density instead of mass?
Use this tool when your data table lists mean bulk density and radius. If you already know total mass M and radius R, use the mass-based surface gravity calculator g = G·M/R².
Why are results rounded to a precision?
Default precision is 10 decimal places; you can set precision from 0 to 15.
How do I calculate surface gravity from density?
Multiply four thirds of pi by the gravitational constant, the mean density and the radius. With 5514 kg/m³ and 6371000 m the result is 9.8212937284 m/s², close to the value on Earth.
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/surface-gravity-from-density \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"density":5514,"radius":6371000}'const res = await fetch("https://api.kit.forhosting.com/mech/surface-gravity-from-density", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"density": 5514,
"radius": 6371000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/mech/surface-gravity-from-density",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"density": 5514,
"radius": 6371000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/mech/surface-gravity-from-density", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"density":5514,"radius":6371000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"density":5514,"radius":6371000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/mech/surface-gravity-from-density", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"density": 5514,
"radius": 6371000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "mech.surface_gravity_from_density",
"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 surface gravity from density means and what the response contains
Surface gravity is the acceleration a test mass would experience at the exterior surface of a spherical body if only Newtonian gravity acted and the body were non-rotating. When the body is modeled as a uniform sphere of mean density rho and radius R, total mass is four thirds pi R cubed times rho, and the usual surface field g equals G M over R squared collapses algebraically to g equals four thirds pi G rho R. That density form is the one this calculator implements: you supply bulk density and radius, not total mass. Zero density or zero radius simply yields zero surface gravity under the linear density form. The response echoes the normalized density and radius you provided, 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_from_density, the precision used, and a short formula reminder that also notes the mass equivalence. 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 density or radius, non-finite values, magnitudes above the documented ceilings, negative density, and any radius that is negative, because a negative radius is non-physical for a surface acceleration in this model. If you already know total mass and radius, prefer the mass-based surface gravity tool; if you need orbital velocity, escape speed, or gravitational potential with a supplied local g, use those dedicated endpoints.
How density 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 density is valid and simply yields zero surface gravity. The preferred fields are density for mean bulk density in kilograms per cubic metre and radius for the mean or equatorial radius in metres, but aliases rho and mean_density for density, and r, R, and planet_radius for radius are accepted so spreadsheets, query strings, and typed forms can reuse the same contract. Radius must not be negative: if radius is negative or negative zero, the request fails with invalid_input because surface gravity g equals four thirds pi G rho R is undefined for a negative radius in this calculator. An optional precision field, with aliases decimals and dp, chooses how many decimal places to expose for density, 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 four-thirds-pi density formula yourself.
Where surface gravity from density 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.
Integration use cases
Deterministic test fixtures
Generate reproducible g values from density and radius for unit tests, property checks, and CI assertions on planetary physics modules.
Technical questions
How is surface gravity defined from density here?
For a uniform sphere of mean density ρ and radius R, g = (4/3)πGρR with G = 6.67430×10⁻¹¹ m³ kg⁻¹ s⁻² (CODATA 2018). This equals G·M/R² when M = (4/3)πR³ρ. The SI unit is m/s².