Physics calculator
Density Calculator
Solve the density, mass, or volume relationship with metric unit conversion.
Density
—
Three modes solve the same equation for different variables
A button row lets you choose what you're solving for. Density mode takes mass and volume and returns density. Mass mode takes density and volume and returns mass. Volume mode takes mass and density and returns volume — the two fields you fill in switch depending on the mode, and only the field being solved for disappears from the inputs.
Every field carries its own unit dropdown: mass in kg or g, volume in m³, L, mL, or cm³, and density in kg/m³ or g/cm³. Everything is converted to SI base units (kilograms, cubic meters, kg/m³) before the arithmetic happens, then converted back to whichever unit you last selected for display.
Volume must convert to a value strictly greater than zero when it's a divisor — that is, in density mode (dividing mass by volume) and in volume mode (dividing mass by density). Mass, by contrast, is allowed to be zero, because a massless object occupying real volume is mathematically valid even if physically unusual.
The density equations
Conversions the calculator relies on: 1 L = 0.001 m³, 1 mL = 1 cm³ = 0.000001 m³, and 1 g/cm³ = 1,000 kg/m³. In density mode, 1,000 kg spread through 2 m³ gives 1,000 ÷ 2 = 500 kg/m³.
In mass mode, water's density of 1,000 kg/m³ filling a 2 L container (0.002 m³) gives a mass of 1,000 × 0.002 = 2 kg. In volume mode, 500 g (0.5 kg) of a substance at 1 g/cm³ (1,000 kg/m³) occupies 0.5 ÷ 1,000 = 0.0005 m³, which is the same as 500 cm³, 500 mL, or 0.5 L.
Why density identifies materials, and where that breaks down
Density doesn't depend on how much of a substance you have — a gram of gold and a kilogram of gold both measure 19.3 g/cm³ — which is why it's used to identify unknown materials and to predict whether something floats. An object floats in a fluid when its overall density is lower than the fluid's; ice at roughly 920 kg/m³ floats in water at 1,000 kg/m³ with about 92% of its volume submerged.
The calculator assumes the mass and volume you enter describe a solid, non-porous sample at whatever temperature it already is. It has no way to adjust for thermal expansion or for hollow or porous objects — a large steel ship floats not because steel is less dense than water (it isn't, at roughly 7,850 kg/m³ versus 1,000 kg/m³) but because the ship's hull encloses a large volume of air, giving the whole vessel an average density well under water's.
Density problems worth checking
Real numbers run through each mode:
- Metal identification: an unknown 3.5 g ring displacing 0.33 cm³ gives 3.5 ÷ 0.33 ≈ 10.6061 g/cm³, close enough to silver's known 10.49 g/cm³ to be worth testing further
- Water as a reference point: 1 L (0.001 m³) of pure water has a mass of exactly 1 kg, which is where the 1,000 kg/m³ figure used throughout this page comes from
- Counterfeit gold bars: a genuine gold bar reads 19,300 kg/m³; a tungsten fake reads suspiciously close at 19,250 kg/m³, while a lead fake reads only 11,340 kg/m³ and is caught immediately
- Ship buoyancy: a hull enclosing 60,000 m³ carrying a total mass of 50,000,000 kg averages 50,000,000 ÷ 60,000 ≈ 833.33 kg/m³, well under seawater's roughly 1,025 kg/m³, so it floats
- Cooking oil separating from water: olive oil at about 920 kg/m³ rises to the top of a water-based sauce for the same reason ice floats
Frequently asked questions
Why does density mode reject a volume of zero?
Density mode divides mass by volume, and dividing by zero is undefined, so the result stays blank rather than showing an error. Volume mode has the same restriction on density for the same reason.
Can I mix units, like grams for mass and cubic meters for volume?
Yes. Each field's dropdown is independent, and every value is converted to kilograms, cubic meters, or kg/m³ internally before the calculation runs, so any combination of units gives a mathematically correct answer.
What's the difference between density and specific gravity?
Specific gravity is a substance's density divided by water's density (1,000 kg/m³), so it has no units — a material at 800 kg/m³ has a specific gravity of 0.8. This calculator reports absolute density only; divide the result by 1,000 kg/m³ yourself to get specific gravity.
Does the calculator adjust for temperature?
No. It only computes from the mass and volume you provide. If your volume was measured at a different temperature than the one you care about, you'll need to account for thermal expansion before entering the number.
Why can mass be zero but volume can't, in density mode?
Zero mass divided by a positive volume gives a valid (if physically odd) answer of zero density. A positive mass divided by zero volume has no defined answer, so that combination is blocked instead.
I switched to Density mode and the result is stuck in kg/m³ — how do I see g/cm³?
The density unit dropdown only appears in Mass and Volume mode, since in Density mode density is the output, not an input. Switch to Mass or Volume mode, set the density selector to g/cm³, then switch back to Density mode — the output will now display in g/cm³ instead.