Density Calculator

Enter any two of mass, volume and density and leave the one you want blank: the calculator solves for it and shows every step with your numbers in place. The density comes back in g/cm3 and kg/m3 together, with the specific gravity and a straight answer to the question everyone secretly has: will it float.

Put this calculator on your website for free

Copy one snippet and give your visitors a working Density Calculator.

How this density calculator works

Density, mass and volume are a triangle: know any two and the third follows. Fill in any two of the three boxes, leave the one you want blank, and the calculator solves for it, showing every step of the rearranged formula with your own numbers in place. Enter a density on its own, or pick a material from the list and let it fill the box for you, and you get the unit conversions, the specific gravity and the float or sink verdict without needing a mass or a volume at all.

Units get taken seriously here, because units are where density problems actually go wrong. Whatever you type in, the answer always shows g/cm3 and kg/m3 together, with the conversion between them walked through as a step, since that factor of exactly 1,000 is the single most common way a correct calculation turns into a wrong answer. And when you are deciding how many digits deserve to survive into a lab report, our significant figures calculator is the referee for that.

The formula

ρ = m ÷ V
m = ρ × V
V = m ÷ ρ

ρ (the Greek letter rho) is density, m is mass, and V is volume. It is one definition in three arrangements: divide to get density, multiply back to get mass, divide the other way to get volume. In base units, mass in grams over volume in cubic centimeters gives density in g/cm3, and multiplying that by exactly 1,000 gives kg/m3.

Worked example

A pocket-sized block of aluminum: 27 g, 10 cm3. Density is mass over volume: 27 / 10 = 2.700 g/cm3, which is 2,700 kg/m3 (times exactly 1,000) and about 168.6 lb/ft3. Specific gravity: 2.700 / 0.999972 = 2.700, with no unit at all. Room temperature water is 0.9970 g/cm3, so aluminum sinks, and it is not close.

The schoolbook landmark works the same way: 1 kg of water in 1 liter is 1,000 g / 1,000 cm3 = 1.000 g/cm3. That tidy 1 is no accident. The gram was originally defined as the mass of one cubic centimeter of water, so water sits at 1 by construction; modern measurement nudged it to 0.999972 g/cm3 at 4 C, the temperature where water is densest.

What density actually is

Density is how tightly matter is packed: how much stuff, divided by how much room the stuff takes up. Lead and styrofoam are not made of heavier and lighter atoms so much as closer and farther ones (and in foam, mostly trapped air). A material has the same density in a pebble as in a boulder, which is what makes it useful: it identifies the material regardless of how much of it you have, which is exactly the trick Archimedes needed.

It also settles the old riddle properly. A kilogram of feathers and a kilogram of steel weigh exactly the same, by definition: a kilogram is a kilogram. The difference is volume. The steel disappears into a coffee mug while the feathers need a sack you could sleep in, because steel is packed a few thousand times more tightly. Density is the number that says so: weight tells you how much you have, density tells you what it is like.

The unit trap: a factor of exactly 1,000

Here is the mistake this page is built to catch. The two everyday density units differ by exactly 1,000: a kilogram is 1,000 g and a cubic meter is 1,000,000 cm3, and dividing one factor by the other leaves a clean thousand behind. So aluminum is 2.70 g/cm3 and 2,700 kg/m3, the same fact in two outfits. Quote a density in the wrong unit and your answer is off by three orders of magnitude, which is why every result here prints both, with the conversion shown as a step.

Two smaller courtesies while we are at it. A cubic centimeter and a milliliter are the same volume, exactly, so a graduated cylinder reading in mL is already reading in cm3. And the US customary units are handled from their exact definitions rather than rounded chart factors: the inch has been exactly 2.54 cm and the pound exactly 453.59237 g since 1959, which makes cold fresh water about 62.4 lb/ft3, the figure US engineering has run on for a century. For plain mass conversions on their own, our kg to lbs converter has you covered.

Why ice floats, and why that matters

Water expands by about 9% when it freezes, because ice locks its molecules into an open hexagonal lattice with more empty space than the liquid has. That drops it to 0.9167 g/cm3, comfortably under liquid water, so ice floats with about 92% of itself submerged in fresh water, and about 89% in denser seawater, which is the arithmetic behind the tip of the iceberg. Nearly every other substance does the opposite and sinks in its own liquid; water is the great exception.

The consequences are bigger than cold drinks. Because water is densest at 4 C, a chilling lake sends its coldest surface water sinking until the whole lake reaches 4 C, and only then can the surface cool further and freeze. The ice then forms a floating lid that insulates the water below, so lakes freeze from the top down and almost never solid. Fish spend the winter in liquid 4 C water under the ice. If ice sank, lakes would freeze from the bottom up and stay frozen, and life as we know it would have had a much harder time of it.

Archimedes, the crown and the bath

The story, as Vitruvius told it two centuries after the fact: King Hiero suspected his goldsmith had cut the crown's gold with silver, and Archimedes, lowering himself into a full bath, watched the water rise and realized the overflow measured the volume of whatever went in. The famous run through Syracuse follows. The details may have grown in the telling, and the honest footnote is that measuring a crown's overflow precisely enough is genuinely hard, which is why later writers, Galileo among them, suspected he really used a balance in water. But the insight underneath is exactly right and is the whole reason density can catch a fraud: equal masses of gold and silver take up different volumes. Silver runs about 10.5 g/cm3 to gold's 19.283, so a pound of silver claims nearly twice the room, and a crown with silver hidden in it displaces more water than the same weight of honest gold.

Displacement is still the standard trick for anything lumpy: weigh it, dunk it, read the rise. For a regular solid you do not even need the bath, just a ruler and the right formula, which is what our cylinder volume calculator and sphere volume calculator are for: measure the volume first, then bring it back here with the mass.

Temperature is part of the number

Mass does not care about temperature, but volume does, so density moves whenever the thermometer does. Water is 0.999972 g/cm3 at 4 C and 0.99704 g/cm3 at 25 C: a small drift for water, and a much bigger one for gasoline, which expands enough that fuel is often sold temperature corrected. This is why a reference table that does not name its temperatures is only mostly telling the truth, and why the table below names them.

Gases take this to the extreme: squeeze or heat a gas and its density changes dramatically, which is why sea level air gets a temperature label too. If you need a gas density, our gas law calculator computes it from pressure, temperature and molar mass, and our molar mass calculator supplies the molar mass from the chemical formula.

Reference table: common densities

Values for water, ice and the elements are CRC Handbook figures at the stated temperatures. Wood, foam, gasoline, milk and concrete genuinely vary from sample to sample, so they get honest ranges rather than a confident fourth decimal. The float column compares against room temperature fresh water.

Materialg/cm3kg/m3In water
Air (sea level, 15 C)0.0012251.225Floats (it is the sky)
Styrofoam (EPS foam)0.011 to 0.03211 to 32Floats
Pine wood0.35 to 0.60350 to 600Floats
Oak wood0.60 to 0.90600 to 900Floats
Gasoline0.71 to 0.77710 to 770Floats (why fuel fires spread on water)
Olive oil0.911911Floats (the salad dressing proof)
Ice (0 C)0.9167916.7Floats (about 92% submerged)
Water (25 C)0.99704997.04This is the water
Water (4 C, its densest)0.999972999.972Sinks below warmer water
Whole milk1.028 to 1.0341,028 to 1,034Sinks
Seawater1.0251,025Sinks (slides under fresh water)
Concrete2.2 to 2.52,200 to 2,500Sinks
Aluminum2.702,700Sinks
Iron7.8747,874Sinks
Mild steel7.857,850Sinks (unless shaped into a hull)
Copper8.968,960Sinks
Lead11.3411,340Sinks
Mercury13.53413,534Sinks (steel floats on mercury)
Gold19.28319,283Sinks (which is how panning works)
Osmium22.5922,590Sinks (nothing natural sinks harder)

One row is a magic trick worth pausing on: mild steel at 7.85 g/cm3 floats on mercury at 13.534, bobbing like a cork, because float or sink is never about being metal or heavy, only about the ratio of two densities. It is the same reason a hundred thousand tons of steel ship floats on water: shape the steel into a hull and the thing displacing the water is mostly air, so the average density of the whole vessel drops below 0.997.

Sources

Where the numbers on this page come from. We go to the body that publishes the figure, not to another calculator. See how we verify.

Frequently asked questions

How do you calculate density?

Divide the mass by the volume. A 27 g block of aluminum that takes up 10 cm3 has a density of 27 divided by 10, which is 2.70 g/cm3. That is the whole formula: density equals mass over volume, written as rho = m / V. The only place it goes wrong in practice is units, so measure mass in grams and volume in cm3 (or convert first) and the answer lands in the unit every reference table uses.

What unit is density measured in?

The SI unit is kilograms per cubic meter (kg/m3), but chemistry mostly runs on grams per cubic centimeter (g/cm3) because the numbers are friendlier: water is about 1 g/cm3 instead of about 1,000 kg/m3. US engineers also use pounds per cubic foot, where cold fresh water is about 62.4 lb/ft3. They all describe the same thing, and this calculator shows g/cm3 and kg/m3 together on every answer.

How do I convert g/cm3 to kg/m3?

Multiply by exactly 1,000. A kilogram is 1,000 grams and a cubic meter is 1,000,000 cubic centimeters, and dividing one factor by the other leaves a clean thousand. Aluminum at 2.70 g/cm3 is 2,700 kg/m3. Going the other way, divide by 1,000. Mixing the two units is the classic density mistake, which is why this page never shows one without the other.

Why does ice float on water?

Because water expands by about 9% when it freezes. Ice holds its molecules in an open hexagonal lattice with more empty space than liquid water has, so it comes out at 0.9167 g/cm3 against liquid water's 0.99704 at room temperature. Less dense floats. Almost every other substance is denser as a solid than as a liquid; water is the famous exception, and it is the reason lakes freeze from the top down instead of the bottom up.

What is specific gravity?

Density divided by the density of water, conventionally water at 4 C where it is densest. Because it is one density over another, the units cancel and the number is the same in every unit system: aluminum's specific gravity is 2.70 whether you started from g/cm3, kg/m3 or lb/ft3. That is exactly why handbooks and hydrometers use it. Below 1 floats in water, above 1 sinks.

How do I find the density of an irregular object?

Weigh it, then use water displacement for the volume: lower it into a measuring container of water, and the rise in the water level is the object's volume, because two things cannot occupy the same space. A stone that raises the level by 40 mL has a volume of 40 cm3, and if it weighs 106 g its density is 2.65 g/cm3, which happens to be quartz. This is the insight tradition credits to Archimedes in his bath, and it works exactly as well today.

Does temperature change density?

Yes, because volume moves with temperature while mass does not. Warm material takes up more room, so density falls as temperature rises: water is 0.999972 g/cm3 at 4 C and 0.99704 g/cm3 at 25 C. That is a small shift for water and a much larger one for gasoline, which is why fuel is often sold temperature corrected. It is also why a serious reference table names its temperature next to every value, and this page's table does.

Related calculators