ForHosting KIT · Science

Planet mass from density and radius calculator

A mean density of 5514 kg/m³ and a radius of 6371000 m give a mass of 5.972802939487484e+24 kg. Work out the mass of any round body from its density and size, with the volume included. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Density
5,514
Radius
6,371,000
You get
Density kg m3
5,514
Radius m
6,371,000
Volume m3
1,083,206,916,845,753,500,000
Mass kg
5,972,802,939,487,484,000,000,000

This planet mass calculator finds the mass of a planet, moon, dwarf planet, or other approximately spherical body when its mean bulk density and radius are known. It first computes the volume of a sphere, four thirds times pi times the radius cubed, then multiplies that volume by density. Enter density in kilograms per cubic metre and radius in metres to receive mass in kilograms. The calculation is deterministic, uses no external data, and rejects zero or negative measurements instead of returning a physically meaningless result.

What the calculator computes

Mass, density, and volume are linked by the basic relation mass equals density multiplied by volume. For a planet represented as a sphere, volume is four thirds multiplied by pi and by the cube of the radius. Combining those relations gives mass equals density times four thirds pi radius cubed.

This calculator applies that expression directly. The required density is the body's mean bulk density, not the density of one rock sample, atmospheric layer, ocean, or core. The required radius is a mean or volumetric radius in metres.

When those inputs use SI units, the cubic metres in the volume cancel the cubic metres in kilograms per cubic metre, leaving kilograms as the mass unit. The response includes the normalized input density and radius, calculated spherical volume, calculated mass, and a readable formula. Returning the intermediate volume makes the result easier to audit and helps reveal unit mistakes.

The calculation assumes an exactly spherical boundary and a density averaged over the entire enclosed volume. It does not claim that the real interior is uniform; a layered planet can still have a meaningful bulk density because total mass divided by total volume is an average.

How to enter density and radius correctly

Use kilograms per cubic metre for density and metres for radius. Astronomy references sometimes publish density in grams per cubic centimetre and radius in kilometres, so convert before calling the calculator. One gram per cubic centimetre equals one thousand kilograms per cubic metre, while one kilometre equals one thousand metres.

These conversions matter greatly because radius is cubed: entering kilometres as though they were metres makes the calculated mass one billion times too small. Both values must be finite and strictly greater than zero. Missing values, text that is not a decimal number, zero, negative values, Infinity, and NaN are rejected as invalid input.

Ordinary decimal strings and scientific notation are accepted, which is convenient for planetary scales such as a radius written as 6.371e6. The operation uses JavaScript finite-number arithmetic and a fixed value of pi, without network access, current-time state, or random sampling. For sound scientific reporting, keep more significant figures in the inputs than you ultimately display and round the returned mass according to the precision justified by the measurements.

Interpreting the result and its limits

The returned mass is the mass implied by the two supplied measurements under the spherical-volume model. Because mass scales linearly with density, a one percent change in density produces a one percent change in mass when radius stays fixed. Because mass scales with the cube of radius, a one percent radius change produces roughly a three percent mass change for small uncertainties.

Radius accuracy therefore deserves special attention. Rapid rotation may make a world oblate, and using an equatorial radius in a spherical formula can bias its volume; a published volumetric mean radius is preferable when available. The model also does not estimate composition, gravitational acceleration, escape velocity, or orbital properties.

Those require additional formulas and inputs. Use the calculated volume and formula fields to document how the answer was obtained, preserve the original measurement units in your own records, and treat the result's significant digits as limited by the least precise input.

Estimate an exoplanet mass

Turn an assumed bulk density and measured radius into a transparent spherical-model mass for comparison or teaching.

Check astronomy homework

Verify the density-times-volume calculation and inspect the intermediate spherical volume before submitting a solution.

What formula does the calculator use?

It uses mass = density × volume, with spherical volume = (4/3)πr³. Therefore mass = density × (4/3)πr³.

Which units should I enter?

Enter bulk density in kilograms per cubic metre and radius in metres. The returned mass is in kilograms.

Does this assume the planet has uniform composition?

It uses mean bulk density over a spherical volume. The actual interior may be layered, but the supplied density must represent the whole body.

What happens if I enter the radius in kilometres by mistake?

The mass comes out one billion times too small, because the radius is cubed. Convert kilometres to metres first by multiplying by 1000, and grams per cubic centimetre to kilograms per cubic metre the same way.

Why does the result also show the volume?

The sphere volume, four thirds times pi times the radius cubed, is the intermediate step. Seeing it makes the answer easy to audit and helps you catch a unit mistake before you use the mass.

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.

POSThttps://api.kit.forhosting.com/astro/planet-mass-from-density

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.

curl -X POST https://api.kit.forhosting.com/astro/planet-mass-from-density \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"density":5514,"radius":6371000}'
{
  "density": 5514,
  "radius": 6371000
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "astro.planet_mass_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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Run it in the browser for quick study or use the API for $0.002 per successful request in repeatable scientific and educational workflows.

How to enter density and radius correctly

If multiplication or cubing exceeds the supported finite numeric range, the request is rejected rather than emitting Infinity.

Interpreting the result and its limits

Browser calculations are free, while each successful API calculation is priced at $0.002.

Create deterministic test fixtures

Generate repeatable mass values for educational software, astronomy demonstrations, or simulation unit tests without external data.

Can density or radius be zero or negative?

No. Both quantities must be finite and strictly positive; otherwise the calculator returns an invalid_input error.

How much does the API calculation cost?

A successful API request costs $0.002. You can also run the same deterministic calculation free in your browser.

Read the full KIT documentation →