The process by which harmful compounds, such as drugs and poisons, are converted to less toxic compounds in the body. Detoxification is an important function of the liver, where enzymes of the smooth endoplasmic reticulum modify drugs and poisons, e.g. by adding hydroxyl groups to make the molecules more water-soluble and thus more readily excreted from the body. See also phase i metabolism; phase ii metabolism.