Gravitational field strength calculator
Earth's mass of 5.972 × 10²⁴ kg at 6,371,000 m from its centre gives a field of 9.81997342622 m/s²: enter any mass and distance to get the pull a test object would feel there. 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
- Distance
- 6,371,000
- G
- 0.0000000001 m/s²
- R squared
- 40,589,641,000,000
- Field strength
- 9.8199734262
Gravitational field strength is the acceleration a small test mass would feel at a chosen distance from a source mass under Newton’s inverse-square law. Students, homework platforms, and physics notebooks need g equals G times M over r squared without hand-calculating scientific notation or guessing which value of G to pin. Zero distance is rejected as invalid input because the field is undefined at the singularity of a point mass.
What gravitational field strength means and how g = GM/r² is applied
In classical mechanics the gravitational field of an isolated mass M is a vector field that points toward the mass and has magnitude g equals G times M divided by r squared at every exterior point a radial distance r from the centre. That magnitude is an acceleration: place a test particle of mass m at that location and the Newtonian force on it is m times g, so the field strength itself is independent of the test mass.
Textbooks introduce the same formula as surface gravity when r equals the planetary radius, and as orbital free-fall acceleration when r is larger than the body. Mass may be zero, which correctly yields zero field; negative mass is rejected because the model is restricted to ordinary Newtonian sources. Distance must be strictly positive: at r equals zero the expression diverges and physics courses label the point-mass singularity as undefined, not as a huge finite number.
Where knowing the field strength helps
Introductory physics courses ask for g at a height above a planet or at a distance from a star; tutors need an oracle that fails closed on r equals zero instead of returning Infinity that a buggy grader might accept. Engineering notebooks estimating acceleration toward a nearby mass, satellite-link calculators comparing free-fall g at orbital radius, and science content sites ranking for gravitational field strength calculator all benefit from a live tool whose free path matches the paid automation path byte-for-byte. Failed validation does not consume balance.
What you can do with it
Classroom and homework checks
Let students enter mass M and distance r and verify g = G·M/r² against textbook methods, including Earth-scale and lab-scale numbers.
Orbit and altitude estimates
Compute free-fall acceleration at centre-to-craft distances for rough orbital and altitude comparisons without a full ephemeris package.
FAQ
How do I calculate gravitational field strength g = GM/r²?
Send finite numbers mass (kg, ≥ 0) and distance (m, > 0).
What happens if the distance is zero?
Gravitational field strength divides by r², so zero separation is undefined and is not billed.
Is this the same as surface gravity?
The formula matches surface gravity when r is the body’s radius. This calculator accepts any positive distance, so it also covers points above the surface or around point masses.
How does the field change as you move away from the mass?
It falls with the square of the distance from the centre: twice as far gives one quarter of the field. That is why the value at an orbital distance is lower than at the planet's surface.
What value of G does the calculator use?
It uses the fixed value 6.6743 × 10⁻¹¹ for the gravitational constant and shows it next to the result, so you never have to guess which figure was applied and can check your own working.
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-field-strength \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"mass":5.972e+24,"distance":6371000}'const res = await fetch("https://api.kit.forhosting.com/mech/gravitational-field-strength", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"mass": 5.972e+24,
"distance": 6371000
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/mech/gravitational-field-strength",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"mass": 5.972e+24,
"distance": 6371000
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/mech/gravitational-field-strength", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"mass":5.972e+24,"distance":6371000}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"mass":5.972e+24,"distance":6371000}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/mech/gravitational-field-strength", 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,
"distance": 6371000
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "mech.gravitational_field_strength",
"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
This gravitational field strength calculator accepts mass in kilograms and distance in metres, multiplies by the fixed CODATA 2018 gravitational constant, divides by r squared, and returns field strength in metres per second squared with the formula and constant echoed for audit.
What gravitational field strength means and how g = GM/r² is applied
This calculator treats the general exterior case: you supply any positive distance, not only a surface radius, so the same endpoint covers Earth surface estimates, low Earth orbit altitudes measured from Earth’s centre, binary-star separations treated as point masses, and classroom problems with arbitrary M and r.
Input contract, response shape, and error behaviour
Example: mass five point nine seven two times ten to the twenty-four kilograms and distance six point three seven one times ten to the six metres (Earth-scale mean radius) yields field strength about nine point eight two metres per second squared, matching the order of magnitude of textbook surface gravity without claiming a full geoid model. POST a JSON body with two required finite numbers: mass (or aliases m, M) as the source mass in kilograms, non-negative; and distance (or aliases r, R) as the centre-to-point separation in metres, strictly greater than zero. Values may arrive as JSON numbers or as numeric strings; missing fields, empty strings, NaN, and Infinity fail with invalid_input naming the field. On success the body echoes mass and distance after stable twelve-significant-digit cleaning, returns G, r_squared, field_strength in m/s², a unit string, a method tag gravitational_field_strength, and the short formula g equals G·M/r². Pair the response with your own unit converters if you prefer kilometres or solar masses; this endpoint stays pure SI so goldens and SDKs stay deterministic.
Where a gravitational field strength API earns its keep
Keep requests small, pin cleaned field_strength values in tests, and you get reproducible accelerations for homework, exams, and edge workers without standing up a symbolic algebra stack of your own.
Integration use cases
Exam and LMS auto-grading
Mark gravitational field strength items with a deterministic oracle that rejects zero distance as invalid_input and never returns Infinity.
Technical questions
Which value of G is used?
CODATA 2018: G = 6.67430×10⁻¹¹ m³ kg⁻¹ s⁻². The response echoes G so you can audit the constant used for the result.
What does the gravitational field strength calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.