Nitrous acid is a relatively weak and unstable acid prepared in situ by the reaction of sodium nitrite and cold, dilute hydrochloric acid. In an acidic solution, the nitrous acid undergoes protonation when it loses water to form a nitrosonium ion—an electrophile. Nitrous acid reacts with primary amines to give diazonium salts. The reaction is called diazotization of primary amines.
Figure 1. The mechanism of the diazotization reaction of primary amines.
As illustrated in Figure 1, in the mechanism of the reaction, a primary amine attacks as the nucleophile on the nitrosonium ion. The subsequent deprotonation yields an N-nitrosamine. Next, the N-nitrosamine readily undergoes keto-enol tautomerism to give a diazotic acid. Protonation of the diazotic acid followed by water loss results in the formation of diazonium ions. The aliphatic diazonium ions formed are extremely unstable and readily decompose to form a carbocation by releasing molecular nitrogen even at 0 °C, which is a good and stable leaving group.