Diazomethane is the chemical compound CH2N2, discovered by German chemist Hans von Pechmann in 1894. It is the simplest diazo compound. In the pure form at room temperature, it is an extremely sensitive explosive yellow gas; thus, it is almost universally used as a solution in diethyl ether. The compound is a popular methylating agent in the laboratory, but it is too hazardous to be employed on an industrial scale without special precautions. Use of diazomethane has been significantly reduced by the introduction of the safer and equivalent reagent trimethylsilyldiazomethane.
For safety and convenience diazomethane is always prepared as needed as a solution in ether and used as such. It converts carboxylic acids into their methyl esters. The reaction is thought to proceed via proton transfer from carboxylic acid to diazomethane to give methyldiazonium cation, which immediately reacts with the carboxylate ion to give the methyl ester and nitrogen gas. Since proton transfer is required and rate limiting, this reaction exhibits high specificity for carboxylic acids over less acidic oxygenated functional groups like alcohols and phenols.
Diazomethane is prepared by hydrolysis of an ethereal solution of an N-methyl nitrosamide with aqueous base. The traditional precursor is N-nitroso-N-methylurea, but this compound is itself somewhat unstable, and nowadays compounds such as N-methyl-N'-nitro-N-nitrosoguanidine (MNNG) and N-methyl-N-nitroso-p-toluenesulfonamide (Diazald) are preferred.
CH2N2 reacts with basic solutions of D2O to give the deuterated derivative CD2N2.
The concentration of CH2N2 can be determined in either of two convenient ways. It can be treated with an excess of benzoic acid in cold Et2O. Unreacted benzoic acid is then back-titrated with standard NaOH. Alternatively, the concentration of CH2N2 in Et2O can be determined spectrophotometrically at 410 nm where its extinction coefficient, ε, is 7.2. The gas-phase concentration of diazomethane can be determined using photoacoustic spectroscopy.
Diazomethane is toxic by inhalation or by contact with the skin or eyes (TLV 0.2ppm). Symptoms include chest discomfort, headache, weakness and, in severe cases, collapse. Symptoms may be delayed. Deaths from diazomethane poisoning have been reported. In one instance a laboratory worker consumed a hamburger near a fumehood where he was generating a large quantity of diazomethane, and died four days later from fulminating pneumonia. Like any other alkylating agent it is expected to be carcinogenic, but such concerns are overshadowed by its serious acute toxicity.
CH2N2 may explode in contact with sharp edges, such as ground-glass joints, even scratches in glassware. Glassware should be inspected before use and preparation should take place behind a blast shield. Specialized kits to prepare diazomethane with flame-polished joints are commercially available.
The compound explodes when heated beyond 100 °C, exposed to intense light, alkali metals, or calcium sulfate. Use of a blast shield is highly recommended while using this compound.
Proof-of-concept work has been done with microfluidics, in which continuous point-of-use synthesis from N-methyl-N-nitrosourea and 0.93M potassium hydroxide in water was followed by point-of-use conversion with benzoic acid, resulting in a 65% yield of the methyl benzoate ester within seconds at temperatures ranging from 0-50 C. The yield was better than under capillary conditions; the microfluidics were credited with "suppression of hot spots, low holdup, isothermal conditions, and intensive mixing."
The stable compound cyanamide, whose minor tautomer is carbodiimide, is an isomer of diazomethane. Less stable but still isolable isomers of diazomethane include the cyclic 3H-diazirine and isocyanoamine (isodiazomethane). In addition, the parent nitrilimine has been observed under matrix isolation conditions.