What is the formula for calculating density?

$\text{Density, } \rho$ $=$ $\text{Mass"/"Volume}$
And thus $\rho = \text{Unit mass"/"Unit volume}$.
Typical units are $g \cdot m {L}^{-} 1$, or $g \cdot c {m}^{-} 3$.