The gram (originally gramme; SI unit symbol g) is a unit of mass in the International System of Units (SI) equal to one thousandth of a kilogram. Originally defined as of 1795 as "the absolute weight of a volume of pure water equal to the cube of the hundredth part of a metre [1 cm3], and at the temperature of melting ice", the defining temperature (≈0 °C) was later changed to 4 °C, the temperature of maximum density of water. By the late 19th century, there was an effort to make the base unit the kilogram and the gram a derived unit.
https://en.wikipedia.org/wiki/Gram