The chemical equation for soap is a fat, such as stearol, plus a strong base, such as sodium hydroxide or potassium hydroxide. This produces glycerol and crude soap, which consists of sodium or potassium salts of fatty acids. The reaction that occurs in making soap is called saponification.
Using different salts results in different textures of crude soap. For example, potassium soap is softer than sodium soap. Crude soap is subjected to further processing to remove impurities. Several repetitions of boiling and precipitating with salt results in soap that can be used as an industrial cleanser. To make laundry, cosmetic and other types of soap, other treatments are applied.