# Nucleophilic acyl substitution

Nucleophilic acyl substitution (S$_N$Acyl) describes a class of substitution reactions involving nucleophiles and acyl compounds. In this type of reaction, a nucleophile – such as an alcohol, amine, or enolate – displaces the leaving group of an acyl derivative – such as an acid halide, anhydride, or ester. The resulting product is a carbonyl-containing compound in which the nucleophile has taken the place of the leaving group present in the original acyl derivative. Because acyl derivatives react with a wide variety of nucleophiles, and because the product can depend on the particular type of acyl derivative and nucleophile involved, nucleophilic acyl substitution reactions can be used to synthesize a variety of different products.

## Reactivity trends

There are five main types of acyl derivatives. Acid halides are the most reactive towards nucleophiles, followed by anhydrides, esters, and amides. Carboxylate ions are essentially unreactive towards nucleophilic substitution, since they possess no leaving group. The reactivity of these five classes of compounds covers a broad range; the relative reaction rates of acid chlorides and amides differ by a factor of 10$^{13}$.
A major factor in determining the reactivity of acyl derivatives is leaving group ability, which is related to acidity. Weak bases are better leaving groups than strong bases; a species with a strong conjugate acid (e.g. hydrochloric acid) will be a better leaving group than a species with a weak conjugate acid (e.g. acetic acid). Thus, chloride ion is a better leaving group than acetate ion. The reactivity of acyl compounds towards nucleophiles decreases as the basicity of the leaving group increases, as the table shows.
| Compound Name | Leaving Group | pK$_a$ of Conjugate Acid |
| Acetyl chloride | | −7 |
| Acetic anhydride | | 4.76 |
| Ethyl acetate | | 15.9 |
| Acetamide | | 38 |
| Acetate anion | N/a | N/a |
Another factor that plays a role in determining the reactivity of acyl compounds is resonance. Amides exhibit two main resonance forms. Both are major contributors to the overall structure, so much so that the amide bond between the carbonyl carbon and the amide nitrogen has significant double bond character. The energy barrier for rotation about an amide bond is 75–85 kJ/mol (18–20 kcal/mol), much larger than values observed for normal single bonds. For example, the C–C bond in ethane has an energy barrier of only 12 kJ/mol (3 kcal/mol). Once a nucleophile attacks and a tetrahedral intermediate is formed, the energetically favorable resonance effect is lost. This helps explain why amides are one of the least reactive acyl derivatives.
Esters exhibit less resonance stabilization than amides, so the formation of a tetrahedral intermediate and subsequent loss of resonance is not as energetically unfavorable. Anhydrides experience even weaker resonance stabilization, since the resonance is split between two carbonyl groups, and are more reactive than esters and amides. In acid halides, there is very little resonance, so the energetic penalty for forming a tetrahedral intermediate is small. This helps explain why acid halides are the most reactive acyl derivatives.

## Reactions of acyl derivatives

Many nucleophilic acyl substitution reactions involve converting one acyl derivative into another. In general, conversions between acyl derivatives must proceed from a relatively reactive compound to a less reactive one to be practical; an acid chloride can easily be converted to an ester, but converting an ester directly to an acid chloride is essentially impossible. When converting between acyl derivatives, the product will always be more stable than the starting compound.
Nucleophilic acyl substitution reactions that do not involve interconversion between acyl derivatives are also possible. For example, amides and carboxylic acids react with Grignard reagents to produce ketones. An overview of the reactions that each type of acyl derivative can participate in is presented here.

### Thioesters

The chemistry of thioesters and acid halides is similar, the reactivity being reminiscent of, but milder, than acid chlorides.