Amides are formed by the reaction of carboxylic acids with ammonia, primary and secondary amines. The reaction is carried out under heating.

At low temperatures, amines react with carboxylic acids as bases and not as nucleophiles.
 
sintesis-amidas
 
This acid-base reaction is impaired when heated, predominating under these conditions the nucleophilic attack that will form the amide.
 
sintesis-amidas
 
The reaction mechanism occurs in the following stages:
 
Stage 1. Addition of ammonia to the carboxylic group
 
sintesis-amidassintesis-amidas
 
Stage 2. Acid-base balance to transform the -OH into a good leaving group
 
sintesis-amidas
 
Stage 3. Water removal
 
sintesis-amidas