To calculate density, the volume of the material must be known. If the object is a regular shape, the volume can be found by using a ruler and one of the equations below.

cubelength (l), width (w), height (h) lwh
spherediameter (d) \frac {4}{3} \pi (\frac{d}{2})^3
cylinderdiameter of base (d), length of cylinder (I) \pi(\frac{d}{2})^2~l
conediameter of base (d), length of cylinder (I) \pi (\frac{d}{2})^2~\frac{l}{3}

If the object has an irregular shape, the volume can be measured using a displacement can.

The displacement can is filled with water above a narrow spout and allowed to drain until the water is level with the bottom of the spout.

As the irregular object is lowered into the displacement can, the water level rises. All the displaced water comes out of the spout and is collected in a measuring cylinder.

The displaced water in the cylinder occupies the same amount of space as the object in the can, which means that their volumes are the same.