Density Calculator
Density is one of the most useful properties of any material because it links how much a substance weighs to how much space it takes up. Formally it is the mass of a sample divided by its volume, and it tells you whether an object will float, how concentrated a solution is, or which of two materials is heavier for the same size. This calculator takes a mass and a volume and returns the density in the unit implied by your inputs, for example grams per cubic centimeter when you enter grams and cubic centimeters, or kilograms per cubic meter when you enter kilograms and cubic meters. The result is shown to two decimal places. Because density depends only on the ratio of the two figures you supply, the tool works for solids, liquids and gases alike; you simply enter the measured mass and the measured volume of your sample. The definitions of mass, volume and the underlying SI base units are maintained by the National Institute of Standards and Technology. Every figure here is computed deterministically from the standard density formula, shown in full below, with a worked example that reconciles exactly to the calculator so you can follow each step yourself and verify the arithmetic.
Density is mass divided by volume: density = mass / volume. A sample with a mass of 200 g and a volume of 250 cm3 has a density of 0.80 g/cm3. The unit follows from the units you enter.
Density formula
rho = m / V
rho = density
m = mass
V = volume
Divide the mass by the volume. The unit of the answer is the mass unit over the volume unit, so grams and cubic centimeters give grams per cubic centimeter. To find mass instead, multiply density by volume; to find volume, divide mass by density.
Worked example
A metal sample has a mass of 200 g and occupies a volume of 250 cm3.
- Identify the mass: m = 200 g
- Identify the volume: V = 250 cm3
- Divide: rho = 200 / 250 = 0.80
- The density is 0.80 g/cm3
So the sample has a density of 0.80 g/cm3, less than water, so it would float. These are the calculator's default inputs, so the result above matches the widget exactly.
Densities of common materials
Approximate densities at room temperature in grams per cubic centimeter.
| Material | Density (g/cm3) |
|---|---|
| Cork | 0.24 |
| Water | 1.00 |
| Aluminum | 2.70 |
| Iron | 7.87 |
| Lead | 11.34 |
Reference densities: US National Institute of Standards and Technology (NIST).
Density Calculator: frequently asked questions
How do you calculate density?
Divide the mass of a sample by its volume: density = mass / volume. If you measure 200 g of material that fills 250 cm3, the density is 200 / 250 = 0.80 g/cm3. Keep the mass and volume units consistent so the result carries the right unit.
What units does density use?
The unit of density is the mass unit divided by the volume unit. Common choices are grams per cubic centimeter (g/cm3) and kilograms per cubic meter (kg/m3). One g/cm3 equals 1,000 kg/m3, which is also the density of pure water at about 4 degrees Celsius.
Why does density tell you if something floats?
An object floats in a fluid when its average density is lower than the fluid's density. Cork at about 0.24 g/cm3 floats on water at 1.00 g/cm3, while iron at 7.87 g/cm3 sinks. This is the principle behind buoyancy.
Does temperature change density?
Yes. Most materials expand when heated, so the same mass occupies a larger volume and the density falls. Water is a notable exception near freezing. For precise work, quote the temperature at which a density was measured.
What is the density formula?
Density equals mass divided by volume (rho = m / V). Rearranged, mass = density x volume and volume = mass / density.
Official sources
- Definitions of mass, volume and the SI base units: US National Institute of Standards and Technology (NIST). As at 25 June 2026.
Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.