Mass density, also known as volumetric mass density or specific mass, is a measure of mass per unit volume. In basic SI units, mass density is expressed as kilograms per cubic meter (kg/m³). This is derived from the base SI units of mass (kilogram, kg) and length (meter, m). The formula is:
Density = Mass / Volume
Therefore, the units become kg/m³.
Several sources confirm this: The Chemistry LibreTexts (https://chem.libretexts.org/Bookshelves/General_Chemistry/Map%3A_A_MolecularApproach(Tro)/01%3A_Matter_Measurement_and_Problem_Solving/1.06%3A_The_Units_of_Measurement) explicitly states that the SI unit for density is the kilogram per cubic meter (kg/m³). Other sources (https://www.chegg.com/homework-help/questions-and-answers/quantity-called-mass-density-mass-volume-mass-per-unit-volume-substance-mass-densities-si--q56100244, https://socratic.org/questions/what-is-the-basic-si-unit-of-density) also reinforce this fact.
While other units might be used in practice (like g/cm³), the basic SI unit remains kg/m³.