# Gravitational Force Calculator

> Computes the attractive gravitational force between two point or spherically symmetric masses at a given centre-to-centre distance with Newton's law and the CODATA 2018 value of G, plus the acceleration each mass experiences.

- Calculator id: `gravitational-force` · Category: Physics (`physics`) · Tool name: `calculate_gravitational_force`
- Canonical page: https://tttkmbb.com/physics/gravitational-force · This document: https://tttkmbb.com/physics/gravitational-force.md · JSON definition: https://tttkmbb.com/physics/gravitational-force.json

## Purpose

Computes the attractive gravitational force between two point or spherically symmetric masses at a given centre-to-centre distance with Newton's law and the CODATA 2018 value of G, plus the acceleration each mass experiences.

**Use when:** You need the gravitational pull between two bodies (planet and satellite, star and planet, two laboratory masses) or the surface gravity of a body from its mass and radius.

**Do not use when:** You only need weight near Earth's surface (use force with 9.80665 m/s²), or relativistic effects matter (near black holes, precision orbits).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `mass1_kg` | number | kg | required | First mass in kilograms (Earth = 5.972e24, Sun = 1.989e30). (> 0) |
| `mass2_kg` | number | kg | required | Second mass in kilograms (Moon = 7.342e22). (> 0) |
| `distance_m` | number | m | required | Centre-to-centre separation in metres (Earth's mean radius = 6.371e6, Earth–Moon = 3.844e8). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `force_n` | number | N | F = G × m1 × m2 / r², attractive along the line joining the centres (rounded to 1e-15 N). |
| `force_micronewton` | number | µN | Same force in micronewtons, convenient for laboratory-scale masses. |
| `acceleration_of_mass2_m_s2` | number | m/s² | F / m2 = G × m1 / r²: the gravitational field of mass 1 at that distance (surface gravity when r is the radius). |
| `acceleration_of_mass1_m_s2` | number | m/s² | F / m1 = G × m2 / r² (rounded to 1e-15 m/s²; negligible for planet-sized mass 1). |

## Formula

`force_n = G × mass1_kg × mass2_kg / distance_m² with G = 6.67430e-11 m³ kg⁻¹ s⁻²; acceleration_of_mass2 = force_n / mass2_kg; acceleration_of_mass1 = force_n / mass1_kg`

Point masses or uniform spheres (shell theorem); inside a body or for irregular shapes the inverse-square law does not apply directly.

## Data Sources

- NIST CODATA 2018 – Newtonian constant of gravitation G — https://physics.nist.gov/cgi-bin/cuu/Value?bg (standard, retrieved 2026-09-23)
- HyperPhysics – Gravity — http://hyperphysics.phy-astr.gsu.edu/hbase/grav.html (reference, retrieved 2026-09-23)
- Wikipedia – Newton's law of universal gravitation — https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/gravitational-force?mass1_kg=…&mass2_kg=…&distance_m=…`
- `POST https://tttkmbb.com/api/v1/calculate/gravitational-force` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/gravitational-force · OpenAPI operationId `calculate_gravitational_force` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "gravitational-force", "inputs": {…}}`

## Example

- Earth and 1 kg at Earth's mean radius: inputs `{"mass1_kg":5.972e+24,"mass2_kg":1,"distance_m":6371000}` → `{"force_n":9.82,"force_micronewton":9819973,"acceleration_of_mass2_m_s2":9.82}`
- Two 1000 kg masses 1 m apart: inputs `{"mass1_kg":1000,"mass2_kg":1000,"distance_m":1}` → `{"force_n":0.000066743,"force_micronewton":66.743,"acceleration_of_mass1_m_s2":6.6743e-8}`

```
GET https://tttkmbb.com/api/v1/calculate/gravitational-force?mass1_kg=5.972e%2B24&mass2_kg=1&distance_m=6371000
```

## Limitations

You only need weight near Earth's surface (use force with 9.80665 m/s²), or relativistic effects matter (near black holes, precision orbits). Point masses or uniform spheres (shell theorem); inside a body or for irregular shapes the inverse-square law does not apply directly. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is the result 9.82 and not 9.81 m/s² for Earth?**

The mean radius and mass give the field of a non-rotating uniform sphere; the measured surface value (about 9.80 average) is lowered by Earth's rotation and flattening.

**Which distance do I use for planets?**

The distance between the centres of mass, not between the surfaces: for surface gravity use the planet's radius.

## Related

- [Force Calculator](https://tttkmbb.com/physics/newtons-second-law.md) — Weight from mass and local g.
- [Potential Energy Calculator](https://tttkmbb.com/physics/potential-energy.md) — Energy of a mass at a height near the surface.
- [Centripetal Force Calculator](https://tttkmbb.com/physics/centripetal-force.md) — Force required to keep a satellite in circular orbit.
