Mix acetyl chloride with sodium methoxide and you get methyl acetate and chloride ion. The methoxy group, CH₃O, has taken the chlorine's place on the carbonyl carbon, and the C=O is still there at the end. That swap is the nucleophilic acyl substitution you met in Esters & amides: the nucleophile replaces the group X (Cl here) on the carbonyl carbon of an acid derivative. This section works through the mechanism in depth.
It starts exactly like Nucleophilic addition and differs only in its second step.
Addition, then elimination
Step 1: the nucleophile adds. A lone pair on the methoxide oxygen attacks the carbonyl carbon. The pi electrons of the C=O move onto oxygen. The result is the same kind of tetrahedral alkoxide intermediate that nucleophilic addition makes: a carbon with four groups, one of them O⁻.
Step 2: the leaving group goes. This carbon still carries its chlorine, and Cl⁻ is a good leaving group. So a lone pair on the O⁻ moves back down and re-forms the C=O pi bond. At the same time the C–Cl bond breaks, and chloride leaves with both of its electrons. The carbon is flat again, with OCH₃ where Cl used to be.
Every acid derivative, RCO–X, reacts this way. A nucleophile adds, and then X⁻ is eliminated. That is why the mechanism is also called addition–elimination.
It is not an SN2 reaction. In SN2 the nucleophile attacks from the side opposite the leaving group, in a single step, and the carbon inverts. Here the nucleophile adds to the C=O first, a real intermediate forms, and the leaving group departs later. The carbonyl carbon is flat before and after, so there is nothing to invert. No carbocation forms either, in the reactions of this chapter, so it is not SN1.
It is a mechanism of its own, and one of the most common ways that bonds between carbon and O, N or Cl are made and broken, in the lab and in living cells.
Why substitution instead of simple addition
You met this fork in Nucleophilic addition. A ketone such as acetone has only carbon groups on its carbonyl carbon. CH₃⁻ cannot leave, and neither can the H⁻ of an aldehyde, so the tetrahedral intermediate takes a proton and stays an alcohol. An acid derivative's intermediate has a group that can leave: Cl⁻, a carboxylate RCO₂⁻, an alkoxide RO⁻, or, reluctantly, an amide ion R₂N⁻.
What pays for the collapse? Not a new C–O bond: the C–O single (sigma) bond was there all along in the intermediate. What the collapse regains is the pi bond on top of it. A C=O pi bond is worth roughly 90 kcal/mol.
That energy has to cover the cost of breaking the C–X bond. Whether it does depends on the leaving group. Cl⁻ is a weak base and holds its electron pair comfortably, so the C–Cl bond breaks easily and the collapse runs downhill.
R₂N⁻ is a very strong base. A collapse that expels it runs uphill. So when an intermediate carries both an NR₂ group and a better leaving group, the better one is expelled instead.
This leaving-group effect is one of the two effects behind the reactivity ladder in Esters & amides; the other is how much X donates into the C=O. Both put acid chlorides at the top and amides at the bottom.
The gap between the ends is large. An acid chloride gives an amide on contact with an amine, while an amide needs hours of hot aqueous acid to hydrolyze.
Which group leaves?
The tetrahedral intermediate often carries two groups that could leave: the nucleophile that just added, and the X that was there from the start. The worked example shows how to choose.
Methylamine, CH₃NH₂, attacks the carbonyl carbon of methyl acetate with its nitrogen lone pair. The nitrogen arrived neutral and now has four bonds, so it carries a positive charge, while the oxygen carries a negative one. A molecule with a positive and a negative charge on different atoms, and no net charge, is called a zwitterion.
Before anything leaves, a second methylamine takes the proton off the N⁺. (At the end, the methoxide that leaves takes that proton back from CH₃NH₃⁺.) Many schemes skip this proton transfer, but a complete mechanism shows it.
Now two groups could leave: CH₃O⁻ and CH₃NH⁻. Compare their conjugate acids. Methanol has pKa 16; an amine N–H has pKa about 38. The lower the pKa, the weaker the base and the better the leaving group, so CH₃O⁻ leaves. The product is N-methylacetamide, an amide.
The reaction does not run backward. Going back would need CH₃NH⁻ to leave, and it will not.
The general rule: when the tetrahedral intermediate carries two groups that could leave, the weaker base leaves. That decides whether a reaction goes forward to a new product or simply reverses to the starting material.
This rule is why the reactivity ladder in Esters & amides runs only downhill: each derivative converts directly only to those below it. The next worked example shows the rule blocking a step uphill.
Try the reverse: methanol and N-methylacetamide. The amide's carbonyl carbon is the least electrophilic on the ladder, so methanol adds slowly if at all. Suppose it does add. Once the protons have moved, the intermediate is the same one as in the last example.
It has the same two groups to choose from, and again CH₃O⁻ leaves. That is the methanol you just added, so you are back at the amide. There is no net reaction.
Without an acid, then, the direct route is not merely slow: its intermediate sends it back. In strong acid the nitrogen can be protonated and leave instead, as the amide-hydrolysis paragraph below explains, but that route is slow and rarely used.
The dependable route goes through the carboxylic acid: hydrolyze the amide, then make the ester from the acid. Both steps are explained further down this page (amide hydrolysis and Fischer esterification). The acid can also go by way of the acid chloride: thionyl chloride, SOCl₂, turns an acid into its acid chloride, and Acid chlorides & anhydrides covers it.
Fischer esterification and the role of acid
Heat acetic acid in methanol with a little sulfuric acid, and methyl acetate and water form. This is Fischer esterification (Esters & amides); here is its mechanism.
Without the catalyst, two things stand in the way. First, the addition is slow: the carbonyl carbon of a carboxylic acid is a weak electrophile (Carboxylic acids), and methanol is a weak, neutral nucleophile. Second, the group that has to leave is OH, which would leave as hydroxide, a strong base and a poor leaving group.
The acid fixes both problems, one proton at a time. First it protonates the carbonyl oxygen. The positive charge makes the carbonyl carbon much more electrophilic, so neutral methanol can add to it.
Later it protonates an OH on the tetrahedral intermediate. The OH becomes OH₂⁺, which leaves as a neutral water molecule, a good leaving group (Leaving groups). You have seen this protonate-to-activate move before, with alcohols, ether cleavage and acetal formation.
In methanol, the sulfuric acid hands its proton to the solvent, so the acid that does the work is protonated methanol, CH₃OH₂⁺. The figure draws all six steps, including the two proton transfers in the middle (steps 3 and 4). In acid, proton transfers like these are the fastest steps of the whole mechanism.
Every step in the figure is reversible, and that is why Fischer esterification stops at an equilibrium: about two-thirds ester with equal amounts of acid and alcohol. To push it further, use a large excess of the alcohol or remove water as it forms (Le Châtelier's principle; Esters & amides).
Now read the figure backward, from methyl acetate to acetic acid, with water adding where methanol added. That is acid-catalyzed ester hydrolysis. It is the same mechanism run in reverse, not a new one to learn.
An ester has two C–O single bonds: one from the carbonyl carbon (the acyl carbon) to oxygen, called the acyl–oxygen bond, and one from that oxygen to the alkyl group. Which one forms and breaks? An isotope label answers it. ¹⁸O is oxygen with two extra neutrons. It reacts like ordinary oxygen, but an instrument that weighs molecules can tell it apart.
Esterify benzoic acid with methanol whose oxygen is ¹⁸O, and all the label ends up in the ester, methyl benzoate, with none in the water. So the methanol oxygen kept its bond to CH₃, and the new bond is the one to the acyl carbon. Hydrolyze ordinary methyl benzoate in H₂¹⁸O, and the label ends up in the benzoic acid, not in the methanol. The bond that broke is again the acyl–oxygen bond.
That holds for esters of methanol and of other primary and secondary alcohols. An ester of a tertiary alcohol can break the other bond in acid instead, because its alkyl group can leave as a stable tertiary carbocation.
Acid also explains a case that looks like an exception. Heat N-methylacetamide in aqueous acid for a long time, and it hydrolyzes to acetic acid and methylammonium ion, CH₃NH₃⁺. Yet CH₃NH⁻ is a very poor leaving group. So how does the nitrogen leave? It never leaves as an anion.
The early steps are those of acid-catalyzed ester hydrolysis, with water as the nucleophile: the C=O is protonated, water adds, and protons move. Then the nitrogen takes a proton while it is still on the tetrahedral intermediate, so it leaves as neutral methylamine. That methylamine then takes the extra proton from the protonated acetic acid. CH₃NH₃⁺ has no lone pair, so it cannot add back, and the hydrolysis does not reverse.
Amides still hydrolyze slowly, because their carbonyl is so unreactive. They need acid or base plus long heating; waiting at room temperature does nothing. In base, the nitrogen takes a proton from water as it leaves, and the carboxylic acid that forms is at once deprotonated to a carboxylate. As in saponification (Esters & amides), that last step pulls the reaction forward.
Ester hydrolysis in base: saponification
Esters & amides showed the three steps of saponification, with their arrows, and why the last one makes it go to completion: the alkoxide that leaves takes the proton from the carboxylic acid (pKa 4.8, against 16 for the alcohol), and nothing attacks the carboxylate that forms. Two points go with that mechanism.
First, saponification uses up the hydroxide: one equivalent per ester. The ester ends up as the carboxylate salt. The base is a reagent here, not a catalyst. To get the carboxylic acid itself, add acid in a separate step at the end.
The same mechanism in biology
Cells make and break acyl bonds by this same mechanism. Proteases, the enzymes that cut proteins, break the amide bonds between amino acids. Ribosomes make those amide bonds. Cells attach fatty acids to coenzyme A, a carrier molecule, as thioesters: esters with sulfur in place of the single-bonded oxygen.
Some drugs work this way too. Aspirin passes its acetyl group, CH₃CO, to the OH of a serine (an amino acid whose side chain ends in OH) in cyclooxygenase, an enzyme that makes the signals behind pain and inflammation. The acetylated enzyme stops working for good. Penicillin's β-lactam, a strained ring amide, acylates a serine in the enzyme bacteria use to build their cell walls (Esters & amides).
The enzyme versions use the same arrows as the flask versions. What the enzyme mainly adds is a nucleophile held in exactly the right place, and nearby groups that pass protons on and off at the right moments.
What carries forward
The next section, Acid chlorides & anhydrides, uses this mechanism at the top of the ladder. In Enolate Chemistry, the Claisen condensation is an acyl substitution whose nucleophile is an enolate, a carbon nucleophile made from a carbonyl compound. In Amines, it is how amines are acylated, that is, turned into amides.
The habit this section teaches carries furthest. Faced with a carbonyl reaction you have not seen, find the tetrahedral intermediate and ask which of its groups is the better leaving group.