Nucleophilic substitution is a chemical reaction where a nucleophile, which is a species that donates an electron pair, replaces a leaving group in a molecule. This process often occurs in organic compounds, where the nucleophile attacks a carbon atom that is bonded to a leaving group, such as a halide. The result is the formation of a new bond and the departure of the leaving group.
There are two main types of nucleophilic substitution: SN1 and SN2. In SN1, the reaction occurs in two steps, with the leaving group first departing to form a carbocation, followed by the nucleophile attacking. In SN2, the nucleophile attacks the carbon simultaneously as the leaving group departs, making it a one-step process.