In order to calculate density you must first determine the volume of the object using the following formula (if the object is square or rectangular shaped, if not a modification of the volume formula must be used):
v = l * w * h
Where:
v = volume (expressed in cubic units, such as cm³, or in mL)
l = length
w = width
h = height
Determine the mass of the object that you want to calculate density.
Now, use the following formula to calculate density:
d = m / v
Where:
d = density
m = mass
v = volume
The SI (International System of Units) unit for density is kilograms per cubic meter (kg/m³). For example:
you have an object with a volume of 225 m³ and a mass of 370 kilograms. Therefore:
d = 370/225
d = 1.64 kg/m³