Ester Formation
To transform a carboxylic acid into an ester, the OH group must be turned into a good leaving group and the acid treated with an alcohol, which is a weakly basic nucleophile.
▶ Watch the video on YouTube
The reaction is carried out with a catalytic amount of a strong mineral acid (hydrochloric or sulfuric acid) capable of protonating the weakly basic C=O group.
Protonation of the C=O group increases the electrophilicity of its carbon and hence its reactivity, even towards weak nucleophiles such as the oxygen of an alcohol.
In the presence of an excess of alcohol, which is usually the solvent as well, the nucleophilic attack takes place.
One of the two lone pairs of the alcohol oxygen attacks the carboxylic acid molecules that have been protonated by the catalytic amount of mineral acid. A tetrahedral intermediate is thus formed with an incipient water molecule as an excellent leaving group.
Loss of water restores the protonated carbonyl group, which is now bonded to the alcohol oxygen.
Deprotonation leads to the ester and gives back the proton for more molecules of starting carboxylic acid to react.
Ester formation takes place in strongly acidic medium, in the presence of an excess of alcohol (the solvent) and in the absence of water.
Conversely, an ester can be turned (hydrolysed) into a carboxylic acid by treatment with the same acid in an excess of water.
The mechanism of both reactions is the same: ester formation is read from left to right and ester hydrolysis from right to left (principle of microscopic reversibility).