Nitriles are organic compounds characterized by a (cyano) functional group. Their formation is a crucial reaction in organic chemistry, particularly for increasing the carbon chain length of a molecule. There are two primary methods for their preparation.
Nitriles can be synthesized by reacting a halogenoalkane with potassium cyanide (KCN). This is a nucleophilic substitution reaction where the halogen atom is replaced by the cyanide group.
Process: A halogenoalkane is heated under reflux with an ethanolic solution of potassium cyanide.
Product: Alkyl cyanides, commonly known as nitriles. The carbon chain is extended by one carbon atom.
General Reaction:
Where is an alkyl group and is a halogen (e.g., Cl, Br, I).
Example: The reaction of bromoethane with potassium cyanide yields propanenitrile.
Aldehydes and ketones undergo a nucleophilic addition reaction with hydrogen cyanide (HCN) across their carbonyl () double bond, forming compounds called cyanohydrins. Cyanohydrins are a specific type of nitrile where the cyano group and a hydroxyl group are attached to the same carbon atom.
Process: Aldehydes or ketones are mixed with a solution of potassium cyanide (KCN) in water containing a small amount of hydrochloric acid (HCl).
Catalysis: Hydrogen cyanide (HCN) is a highly toxic gas. To avoid direct handling, it is generated in situ by the reaction of KCN with HCl. The KCN solution also provides free cyanide ions (), which act as a powerful nucleophile and catalyst for the addition reaction.
General Reaction:
Where and can be alkyl groups or hydrogen atoms. If or is H, it is an aldehyde; if both are alkyl, it is a ketone.

Example: The reaction of propanal with hydrogen cyanide yields 2-hydroxypropanenitrile (propanal cyanohydrin).
A key feature of both nitrile formation reactions is the increase in the length of the carbon chain. This occurs because the incoming cyanide group () introduces an additional carbon atom into the molecule. This property makes these reactions invaluable tools in organic synthesis for building more complex carbon skeletons from simpler starting materials.
Nitriles are also versatile intermediates; for instance, they can be hydrolyzed to carboxylic acids.