ForHosting KIT · Science

Mass to density calculator

An object of 12 kg that fills 3 m³ has a density of 4 kg/m³. Enter the mass you weighed and the volume you measured to get the density, with a clear refusal when the volume is zero or negative. 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
Mass
12
Volume
3
You get
Density
4
Density unit
kg/m³

Mass-to-density conversion is the directed physics identity every lab bench and homework sheet starts with: you already weighed an object and you already measured the space it occupies, and you need the resulting density in kilograms per cubic metre. This mass to density calculator takes those two numbers, divides mass by volume, and returns ρ in SI units with no material table, no unit converter, and no rearrangement for a missing mass or volume.

What mass to density means and which SI units to send

Mass-to-density conversion is the one-direction form of the classical definition of bulk density: rho equals mass divided by volume when a body is treated as uniform. The algebra is a single quotient, but the product contract is stricter than a three-way rearrangement: both mass and volume must be present, density is never an input, and a zero or negative volume is refused because an object cannot occupy a vanishing or inverted volume. That refusal is the reason a dedicated mass to density calculator exists beside more general density-mass-volume solvers.

Homework sheets, packing lists, and specimen cards usually already know the two measured quantities and only want ρ in kg/m³; they do not want to omit a field among three optional knobs and hope the engine guessed which unknown to fill. Search queries cluster around mass to density, convert mass to density, and density from mass and volume—phrases that describe a directed conversion rather than a missing-quantity puzzle.

Homework density from a weighed specimen

Students send a measured mass in kilograms and a displaced volume in cubic metres and check the returned kg/m³ against the textbook quotient ρ = m / V.

Packing-list bulk density checks

Warehouse scripts convert a known object mass and a measured carton volume into kilograms per cubic metre before comparing the figure to a shipping density band.

Lab specimen cards without a material table

Bench notes divide a recorded sample mass by its measured volume to stamp density in kg/m³, with a hard error if the volume was logged as zero or negative.

How do I convert mass and volume into density?

Send finite numbers mass (kg) and volume (m³).

What happens if volume is zero or negative?

Density is mass divided by volume, so a zero or negative volume is undefined for an object and is not billed.

What units does the mass to density calculator use?

SI only: mass in kilograms, volume in cubic metres, density in kilograms per cubic metre. The engine does not convert grams, millilitres, or other prefixes.

What density do I get for an object that is not uniform?

You get its bulk density: the total mass divided by the total volume, as if the material were spread evenly. For a hollow or mixed object, that is an average, not the density of any one part.

Can the mass be zero?

Yes. A mass of zero is accepted and simply gives a density of zero. Only the volume has to be strictly positive, because dividing by a vanishing or negative volume makes no physical sense.

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/phys/mass-to-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/phys/mass-to-density \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mass":12,"volume":3}'
{
  "mass": 12,
  "volume": 3
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "phys.mass_to_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.

Zero and negative volumes are rejected as invalid_input because an object cannot occupy a vanishing or inverted volume under this contract.

What mass to density means and which SI units to send

In SI, mass arrives in kilograms, volume arrives in cubic metres, and density leaves in kilograms per cubic metre, which is the unit this endpoint always reports in the density field and restates in density_unit. Identical inputs always produce identical JSON because the path is pure arithmetic with no network, no random seed, and no wall clock in the computation.

Input contract, response shape, and zero or negative volume errors

A zero volume would divide by zero; a negative volume would invert the object, which is outside this contract. Mass may be zero, in which case density is zero. There is no material table, no temperature correction, no specific-gravity conversion, and no unit converter; this is ideal uniform-sample arithmetic from the two known quantities. POST a JSON body with two required finite numbers: mass, the object mass in kilograms, and volume, the object volume in cubic metres. Aliases are accepted so forms and scripts can speak the names they already use: m or mass_kg for mass; V, vol, or volume_m3 for volume. Numeric strings parse the same way as JSON numbers. Missing fields, empty strings, non-numeric text, NaN, and Infinity all fail immediately with invalid_input naming the field, and failed validation is not charged. After both values are accepted, volume is checked against the physical bound that makes the quotient defined: if volume is zero or negative the task fails with invalid_input and a message that density ρ=m/V is undefined for zero or negative volume. On success the response echoes mass and volume with stable rounding, reports density as mass divided by volume in kilograms per cubic metre, sets density_unit to kg/m³, sets formula to the Unicode rho equals m slash V identity, and sets method to mass_to_density so clients can branch without sniffing shapes.

Where a mass to density calculator earns its keep

Use the browser mass to density calculator when you want an immediate physics check while grading homework, verifying a bench mass-and-volume measurement, or converting a packing-list mass and a measured box volume into kg/m³ before you compare the result to a published material range. Choose units consistently: mass must be kilograms and volume must be cubic metres so density comes out in kilograms per cubic metre. Results are fully deterministic: the same two inputs always yield the same density, the same unit string, and the same formula label. There is no language model, no external materials service, and no randomness, so the capability is safe to pin in continuous-integration checks and reproducible lesson materials. Each successful request is one billable item at $0.002; failed validation does not consume balance. If your source data is grams and millilitres, convert those quantities first; this endpoint does not rescale units and will not guess a prefix. Wire the endpoint into mechanics drills, contest answer checkers, materials worksheets, or preprocessing steps where you already prefer explicit domain errors—such as rejecting a zero or negative volume—over opaque widgets that cannot explain why a bad input was refused. Pair this endpoint with buoyancy or hydrostatic tools when the next step needs density as an input, or keep it standalone when the only unknown is ρ from a known mass and volume.

Can I send density and solve for mass or volume instead?

No. This endpoint is one-way: both mass and volume are required, and density is always the computed output. Omit neither field.

What does a successful API call cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →