How to calculate density.
Density is mass per unit volume. In other words, what is the weight of a volume of material?
Water is (at 4ºC) 1. This means 1 ml of water weigh 1 gram. ρ = 1 g/cm3.
The only thing common between any materials is volume. No matter what, 1ml will always be 1ml. Of course, 1 gram will always be 1 gram, but 1 gram might not have the volume of 1ml.
You can calculate the density of a material by measuring the volume of a mass (or mass of a volume) and do the calculation.