A detergent is a type of surfacant commonly used in cleaning products like laundry detergents, shampoos, and degreasers. The efficacy of a detergent molecule is based on the combination of a polar hydrophilic group at one end of the molecule and a non-polar hydrophobic group at the other end. Detergents emulsify chemicals in solvents in which they normally would not be soluble. Thus, laundry soap can emulsify grease into water.
Typically, a detergent contain a non-polar, long, alkyl chain of at least twelve carbon atoms at one end of its molecule and a polar hydrophilic group at the other end (as the sodium or ammonium salt), other than a carboxylic acid salt. Detergents are often synthetic versions of soap, in which the carboxylic end of soap has been replaced by another hydrophilic group, such as sulfate. This is done to reduce the problem of scum that is associated with using soap in hard water. Whereas soap tends to precipitate in the presence of magnesium or calcium ions, detergents precipitate to a lesser degree and thereby reduce scum. Some detergent formulations also including metal sequestering chemicals, such as tetrasodium-ethylene diamine tetraacetic acid (EDTA), to bind to the calcium and magnesium ions present in hard water to lessen the buildup of scum.
Sodium lauryl sulfate (also called sodium dodecyl sulfate), developed from nuts oils, is formed in the reaction of 1-dodecanol with sulfuric acid. It contains both a long, twelve carbon atom hydrophobic alkyl section, and a very hydrophilic group, sulfate, on the other end. If the sulfate group were replaced with a carboxylic acid salt, this compound would be called a soap. Ammonium ions are also frequently used in place of the sodium, in detergents such as ammonium lauryl sulfate, commonly used in shampoo, and ammonium lauryl ether sulfate. Longer detergents, such as stearyl sulfate, with eighteen carbon atoms, are also quite commonly used, as are sulfonates.