Diazomethane is a quite interesting compound that is used in many synthetic transformations.
So, before going over these reactions, let’s draw the structure of diazomethane by showing the corresponding resonance structures:

The main theme that gives the characteristic reactions of diazomethane is the presence of the two nitrogens, which ultimately serve as an excellent leaving group – the molecular nitrogen gas, N2.
Conversion of Carboxylic Acids to Methyl Esters by Diazomethane
To see how this happens, let’s start with the conversion of carboxylic acids to methyl esters by their reaction with diazomethane:

What happens here is that the CH2 group of the diazomethane is protonated, which creates a ready-to-go precursor to react with a nucleophile, which in the case of carboxylic acids is their conjugate base:

Diazomethane as a Nucleophile
Now, let’s also see how diazomethane behaves if there is no proton source in the media. In one of the resonance structures, we can see the negatively charged carbon of the methylene group, which acts as a nucleophile.
The most common example is perhaps the attack of diazomethane on an acid chloride, which creates diazo carbonyls:

And here we are going to see again how the possibility of expelling molecular nitrogen drives forward some rearrangement reactions. One such example is the Wolff rearrangement, where a diazo carbonyl is converted to a ketene. This is accompanied by a 1,2-alkyl shift which is facilitated by loss of molecular nitrogen:

Ketenes are highly reactive intermediates which, due to the electrophilicity of the central carbon atom, react with a variety of nucleophiles, such as water, alcohols, amines, thiols, and acid derivatives such as acetate ions:

The hydrolysis of the ketene formed via the Wolff rearrangement is known as the Arndt-Eistert reaction, which is a particular example of a Wolff rearrangement:

As a closing note on the mechanism of alkyl-shift rearrangements of diazo carbonyls, notice the similar pattern that we have seen in the Curtius rearrangement, where we also had a loss of N₂, except the intermediate was an acyl azide:

The Reaction of Diazomethane with Aldehydes and Ketones
Similar to the homologation reactions of carboxylic acids, ketones can also react with diazomethane to extend the carbon chain of the alkyl groups. One such example is the conversion of cyclohexanone to cycloheptanone:

The reaction starts with a nucleophilic addition to the carbonyl group, forming a diazohydrin intermediate, which undergoes a ring-expansion rearrangement aided by the loss of nitrogen, as we have seen earlier:

Formation of epoxides, as well as homologous ketones, is also possible when diazomethane is reacted with aldehydes and ketones:

All the details and mechanisms for the formation of these products are beyond the scope of this post, but you can find them in the book by Gutsche, C. D. The Reaction of Diazomethane and Its Derivatives with Aldehydes and Ketones. Organic Reactions; Wiley: 1954; Vol. 8.
Cyclopropanation of Alkenes
Diazomethane also has this feature of turning into a carbene (:CH₂), which is a highly reactive species with a carbon atom that has only six valence electrons. This again happens through the loss of molecular nitrogen, upon heating or irradiation of diazomethane with UV light:

The carbene can then react with an alkene by adding to the C=C bond. Both new C–C bonds are formed at the same time, converting the alkene into a cyclopropane:

This is a useful way of converting an alkene into cyclopropane derivatives by adding a CH₂ group across the double bond.
Diazomethane in Cycloaddition Reaction
Recall the Diels-Alder reaction, which was similar to this, only it was a 4+2 cycloaddition reaction because it occurred between a 4π electron system, the diene, and a 2π electron system, the alkene:

Now, another infamous cycloaddition reaction that you may not cover in your class is the “Click Reaction,” where an azide reacts with an alkyne, forming a 1,2,3-triazole:

It is called “click” because the reaction is highly efficient, selective, and reliable, essentially allowing two molecular components to be “clicked” together under mild conditions.
Mechanistically, the click reaction is a 1,3-dipolar cycloaddition because it occurs between a 1,3-dipole, the azide, and a dipolarophile, the alkyne, forming a five-membered ring.
The reaction has found tremendous application in organic and biological chemistry for preparing sensors, pharmaceuticals, polymers, and for labeling biomolecules. In fact, the 2022 Nobel Prize in Chemistry was awarded jointly to Carolyn R. Bertozzi, Morten Meldal, and K. Barry Sharpless “for the development of click chemistry.
So why are we talking about the Diels-Alder and click reactions here? It is because there are also1,3-dipolar cycloadditions of diazo compounds, including diazomethane, to alkynes, which form pyrazoles:

Diazo compounds can also undergo 1,3-dipolar cycloaddition reactions with alkenes, forming pyrazolines.
Summary of the Reactions of Diazomethane
To summarize what we have discussed about the reactions of diazomethane, remember that it is a source of a methyl group under acidic conditions because the CH2 group is protonated, allowing it to react with a nucleophile, while N₂ serves as an excellent leaving group.
Under neutral conditions, diazomethane acts as a nucleophile and is mostly used to prepare diazocarbonyl compounds, which can undergo rearrangements to form ketenes. These highly reactive ketenes can then react with many nucleophiles, such as water, amines, and thiols.
Diazomethane and other diazo compounds can also act as 1,3-dipoles in 1,3-dipolar cycloaddition reactions, reacting with alkenes and alkynes to form pyrazolines and pyrazoles, respectively.
With all these nice things, we ought to mention that diazomethane is highly toxic and potentially explosive. It is a yellow gas at room temperature, with a boiling point of about −23 °C, and can undergo explosive decomposition, particularly when heated or exposed to shock, friction, or certain surfaces and impurities.
Reference
- Black, T. H. The Preparation and Reactions of Diazomethane. Aldrichimica Acta 1983, 16 (1), 3-10.
- Pechmann, H. v. Pyrazol aus Acetylen und Diazomethan. Dtsch. Chem. Ges. 1898, 31, 2950–2951. DOI: 10.1002/cber.18980310363.
- Gutsche, C. D. The Reaction of Diazomethane and Its Derivatives with Aldehydes and Ketones. Organic Reactions; Wiley: 1954; Vol. 8.
- Pechmann, H. v. Ueber Diazomethan. Dtsch. Chem. Ges. 1894, 27 (2), 1888-1891.
- Diazo Compounds: Versatile Tools for Chemical Biology. ACS Chem. Biol. 2016, 11, 3233–3244.
- Clayden, J.; Greeves, N.; Warren, S.; Wothers, P. Organic Chemistry; Oxford University Press: Oxford, 2001.
Check Also
- Curtius Rearrangement
- Preparation of Carboxylic Acids
- Naming Carboxylic Acids
- Naming Nitriles
- Naming Esters
- Naming Carboxylic Acid Derivatives – Practice Problems
- The Addition-Elimination Mechanism
- Fischer Esterification
- Ester Hydrolysis by Acid and Base-Catalyzed Hydrolysis
- What is Transesterification?
- Esters’ Reaction with Amines – The Aminolysis Mechanism
- Ester Reactions Summary and Practice Problems
- Preparation of Acyl (Acid) Chlorides (ROCl)
- Reactions of Acid Chlorides (ROCl) with Nucleophiles
- R2CuLi Organocuprates – Gilman Reagent
- Reaction of Acyl Chlorides with Grignard and Gilman (Organocuprate) Reagents
- Reduction of Acyl Chlorides by LiAlH4, NaBH4, and LiAl(OtBu)3H
- Reduction of Carboxylic Acids and Their Derivatives
- Preparation and Reaction Mechanism of Carboxylic Anhydrides
- Amides – Structure and Reactivity
- Naming Amides
- Amide Hydrolysis: Acid- and Base-Catalyzed Mechanism
- Amide Dehydration Mechanism by SOCl2, POCl3, and P2O5
- Amide Reduction Mechanism by LiAlH4
- Reduction of Amides to Amines and Aldehydes
- Amides Preparation and Reactions Summary
- Amides from Carboxylic Acids-DCC and EDC Coupling
- The Mechanism of Nitrile Hydrolysis To Carboxylic Acid
- Nitrile Reduction Mechanism with LiAlH4 and DIBAL to Amine or Aldehyde
- The Mechanism of Grignard and Organolithium Reactions with Nitriles
- The Reactions of Nitriles
- Converting Nitriles to Amides
- Carboxylic Acids to Ketones
- Esters to Ketones
- Synthesis and Reactions of Lactones and Lactams
- Carboxylic Acids and Their Derivatives Practice Problems
- Carboxylic Acids and Their Derivatives Quiz
- Reactions Map of Carboxylic Acid Derivatives