The process of forming diazonium compounds is called "diazotation", "diazoniation", or "diazotization". The reaction was first reported by Peter Griess in 1858, who subsequently discovered several reactions of this new class of compounds. Most commonly, diazonium salts are prepared by treatment of aromatic amines with nitrous acid and additional acid. Usually the nitrous acid is generated in situ (in the same flask) from sodium nitrite and the excess mineral acid (usually aqueous HCl, , p-, or ):
Chloride salts of diazonium cation, traditionally prepared from the aniline, sodium nitrite, and hydrochloric acid, are unstable at room temperature and are classically prepared at 0 – 5 °C. However, one can isolate diazonium compounds as tetrafluoroborate or tosylate salts, which are stable solids at room temperature. It is often preferred that the diazonium salt remain in solution, but they do tend to supersaturate. Operators have been injured or even killed by an unexpected crystallization of the salt followed by its detonation.
Due to these hazards, diazonium compounds are often not isolated. Instead they are used in situ. This approach is illustrated in the preparation of an arenesulfonyl compound: