Density, unlike many other material properties, is an intensive property. That is, it is independent of the amount or quantity of the substance. Density of a material is the ratio of its mass to its volume and is given as:
Density = mass/volume
As the shape or the quantity of the material changes, mass and volume will change, but not the density. By the modifications in mass and volume, due to changes in shape or size, the density remains constant. Mass and volume are thus extensive properties and depend on the shape or size of the object. The bigger the object, more would be its mass and volume. For example, a handful of sand when compared to a pinch of sand, will occupy more volume and will have more mass, but the same density.
Hope this helps.