What is the formula for soap
For centuries, humans have known the basic recipe for soap — it is a reaction between fats and a strong base. The exact chemical formula is C17H35COO- plus a metal cation, either Na+ or K+. The final molecule is called sodium stearate and is a type of salt. Depending on the metal cation, soaps are either potassium salts or sodium salts arranged as long-chain carboxylic acids.
Typically, the formation of these chains involves combining potassium hydroxide with an animal or vegetable fat, or sometimes with acetic acid . A soap molecule does two things — it bonds to both water and debris. That is due to its hydrophilic, or "water-loving," and hydrophobic, or "water-fearing," components. A molecule of soap has a hydrophilic anionic "head" and a hydrophobic "tail" made of hydrocarbons. The head of the molecules is attracted and dissolves in water, while the hydrocarbon tail is attracted to dirt and grease, and repelled by water.
Soap is also a surfactant — it reduces the surface tension of water. Water has a strong surface tension , which causes drops to bead on a variety of surfaces ranging from metal to fabric. That slows water's wetting process and inhibits its ability to clean. Because soaps lessen the surface tension of water, it can spread and wet more easily. Also, surfactants loosen and emulsify dirt and debris, dispersing it in water and allowing it to get rinsed away.
Today, the process of making soap most commonly involves reacting an organic acid with an alkaline chemicals like potassium hydroxide or sodium hydroxide. Industrially, the caustic soda base used most often is sodium hydroxide, which is also called lye. The main difference between potassium and sodium soaps is consistency — usually, potassium makes a softer, more water-soluble soap than sodium.