Density is the link between how much stuff you have and how much space it takes. A kilogram of feathers and a kilogram of lead weigh the same, but the feathers fill a room and the lead fits in your hand. Density, mass divided by volume, captures that difference in one number. This calculator solves the density triangle: give it any two of density, mass, and volume, and it finds the third.
The triangle is easy to remember. Cover the value you want: mass is density times volume, volume is mass divided by density, and density is mass divided by volume. Units must match before you calculate. This tool uses grams, millilitres, and grams per millilitre, which suit school labs. One gram per millilitre is the same as one kilogram per litre and one gram per cubic centimetre, because one millilitre is one cubic centimetre.
Here is a worked example. A sample weighs 100 grams and fills 50 millilitres. Its density is 100 divided by 50, which is 2 grams per millilitre, twice as dense as water. Now turn it around: how much does 250 millilitres of a liquid with density 0.8 grams per millilitre weigh? Mass is 0.8 times 250, which is 200 grams. The same triangle answers both questions, and the tool picks the right rearrangement from your choice of unknown.
Density identifies materials, roughly. Pure water is 1 gram per millilitre at room temperature. Cooking oil is about 0.9, so it floats on water. Iron is about 7.9, aluminium about 2.7, and gold about 19.3. If a metal sample claims to be gold but measures 10 grams per millilitre, it is not pure gold. Density alone never proves identity, because alloys mix densities, but a density far from the expected value is a strong warning sign.
Temperature quietly changes density, because most things expand when warm. Water is the famous exception near freezing, but for most liquids, warming lowers density as the same mass spreads over more volume. A density measured on a hot day is not quite the density in a cold room. For school work, ignore this unless the problem gives a temperature. For careful work, always note the temperature beside a density value.
Two traps catch students. The first is mixing units: grams with litres, or kilograms with millilitres, without converting. Convert everything to grams and millilitres first, then calculate. The second is porous or hollow samples: a sponge has a low average density because it is mostly air, and a hollow ball has a lower average density than the solid metal it is made of. The triangle gives average density, and it cannot tell you what is inside.
Use this calculator as a practice aid for study and homework, not as lab procedure. It is an educational estimator, and real density work follows a written protocol, a supervisor, and safety rules for the samples involved. Check any density you rely on against a reference table, and if a result would decide whether a material is safe or genuine, get it measured properly instead of trusting a web calculation.
Irregular solids are measured by displacement, because no ruler can follow a strange shape. Fill a graduated cylinder with water, record the level, lower the solid in, and record the new level: the rise is the solid volume. A rock that lifts the water from 50 to 73 millilitres has a volume of 23 millilitres, and if it weighs 69 grams, its density is 69 divided by 23, which is 3 grams per millilitre. Two cautions apply. The solid must not dissolve or soak up water, or the rise undercounts the volume, and trapped air bubbles cling to rough surfaces and inflate it, so tap the cylinder gently and read the level at eye height, at the bottom of the meniscus.
