nucleoplic substitution header image- students carrying out a practical activity in the lab.

Nucleophilic substitution reactions involving halogenalkanes

🧠 Brain Box: Bases and Nucleophiles

Brønsted–Lowry base 🧪 a substance that accepts a H+ (a proton). If it can grab a hydrogen ion, it’s acting as a base.

Nucleophile 🧲 a species that donates a lone pair of electrons to a positively charged or δ+ atom (usually carbon) to form a bond.

Nucleophilicity ⚡ a measure of how good a nucleophile is at donating its lone pair and forming a bond with an electrophile.

🧠 Exam habit: always ask “Am I removing a H+ or attacking a carbon?”

This page give some details on the nucleophilic substitution reactions of halogenalkanes with nucleophiles such as: hydroxide ions (OH-), cyanide ions (CN-) and the neutral molecule ammonia (NH3) . If you are not familiar with the mechanism of nucleophilic substitution reactions I would suggest you review this before studying the rest of this page.


Halogenalkanes and hydroxide ions

Alcohols (R-OH) can be produced by the reaction of a halogenalkanes (R-X) when it is warmed with an aqueous solution of sodium hydroxide or potassium hydroxide.

You are probably familiar with potassium and sodium hydroxide from any work you have done on acids, alkalis and neutralisation reactions where the sodium hydroxide and potassium hydroxide would have been used as a base (a Brønsted–Lowry base); that is as hydrogen ion (H+) acceptors.

However the hydroxide ion (OH-) can also behave as a nucleophile. There are many similarities between nucleophiles and bases; for example they both possess lone pairs of electrons. Usually strong bases are also good nucleophiles and vice versa. However with sodium and potassium hydroxide we can adjust the reaction conditions to "make it" behave as a base or a nucleophile.


Potassium and sodium hydroxide: Base or nunclephile?


Sodium and potassium hydroxide solutions in a lab with an explanation about hydroxides as strong alkalis.
Sodium and potassium hydroxide solutions in a lab with an explanation about hydroxide ion acting as a nucleophile.

Nucleophilic substitution reactions

In the reaction shown below sodium hydroxide is reacting with the halogenalkane bromoethane. Now in a warm aqueous solution of sodium hydroxide, the hydroxide ion (OH-) will behave as a nucleophile; indeed this is a typical nucleophilic substitution reaction where the hydroxide ion uses one of its lone pairs of electrons to attack the partially charged carbon atom in the polar C-Br bond. The product of this reaction is the alcohol ethanol and the salt sodium bromide which of course will be in solution.


Mechanism and reaction conditions for the preparation of alcohols from halogenalkanes.  The reaction of bromoethane and sodium hydroxide is used as an example.

Solubility problems

🧠 Exam Brain Box: OH- can do two jobs

When a haloalkane reacts with sodium hydroxide, the hydroxide ion (OH-) can act as either a nucleophile or a base — the conditions decide 🧪

✅ Quick memory hook:
🌊 Aqueous = substitution (alcohol)
🔥 Ethanolic + hot = elimination (alkene)

The main problem with the set-up above is that halogenalkanes are pretty much insoluble in water, this means that the reaction is going to be very slow. To improve the solubility problem you could add the alcohol ethanol to the aqueous sodium hydroxide to produce what is often called an ethanolic sodium hydroxide solution. The halogenalkane would be soluble in this alcoholic/aqueous solution but unfortunately this may lead to a different type of reaction occurring; that is an elimination reaction; this elimination reaction we would not produce the desired alcohol but instead lead to the formation of unsaturated alkenes; not what we want!

A better solution to the solubility problem would be to set-up a reflux reaction using the halogenalkane and the aqueous sodium hydroxide, this would allow sufficient time for the reaction to take place and also help force it forwards to produce the product. A typical reflux set-up is shown below in the nitrile section of this page.


Halogenalkanes and cyanide ions- making nitriles

Nitriles contain the functional group R-CN, nitriles are particularly useful in organic synthesis are they are one of the few ways in which it is possible to extend the carbon chain by one carbon atom. Nitriles are also reactive and are easily converted into other useful and reactive molecules such as amines, amides and carboxylic acids. The first two members of the nitriles homologous series are shown below:

3d models, displayed formula and molecular formula of ethanenitrile and propanenitrile. Nitriles can be made by reacting a halogenalkane with an warm aqueous/alcoholic solution of potassium or sodium cyanide, this nucleophilic substitution reaction (SN2) is carried out under reflux conditions as shown in the image below, for example the primary halogenalkane bromoethane reacts with the cyanide ion (:CN-) to form propanenitrile. The cyanide ion (:CN-) uses its lone pair of electrons to attack the δ+ carbon atom in the poalr C-Br bond. The mechanism for this reaction is shown below:
Mechanism  and symbolic equation for the reaction of sodium cyanide with a halogen alkane, bromoethane.  The reflux apparatus diagram is also shown.

Halogenalkanes and ammonia

🧠 Brain Box: Key Words (Haloalkanes)

Ammonia reacts with halogenalkanes to produce amines. Amines are simply molecules of ammonia(NH3) where one or more of the hydrogen atoms on the ammonia molecule have been replaced by an alkyl group (-R), for example:


It is possible to have four alkyl groups around the nitrogen atom in an ammonia molecule, however these compounds containing four alkyl groups are ionic solids and are called quaternary ammonium salts (see below for more details).

3d models, displayed formula and molecular formula of primary, secondary and tertiary amines.

Nucleophile or base?

Before we look at the mechanism of the reaction between ammonia and halogenalkane molecules consider the two reactions of ammonia shown below, study the image below and ask yourself how are these two reactions similar and how are they different? As was mentioned above molecules with lone pairs of electrons can act as either nucleophiles or bases.


Mechanism to show how ammonia can act as a nucleophile and as a base in its reactions with halogenalkanes or alkyl halides.




Nucleophilicity, nucleophiles and bases

🧠 Key terms: nucleophiles, bases & nucleophilicity (plus solvents!)

Whether the substance in question acts as a nucleophile or a base will largely depend on the reaction conditions used, that is for example the temperature or the particular solvent used to carry out the reaction in question. In summary we can say that in most cases good bases are also good nucleophiles and that there are several factors affecting nucleophilicity; including:


Aminolysis- making amines from ammonia

Now amines can be made by reacting ammonia with halogenalkanes, this is a typical nucleophilic substitution reaction. However you need to consider the fact that ammonia is a gas at room temperature, it is also very soluble in water however when heated any dissolved ammonia gas would be given off, so any reaction involving ammonia gas needs to be carried out in sealed vessels.

The mechanism for the nucleophilic substitution reaction of bromomethane and ammonia is shown below; you should note that 2 moles of ammonia are used for every mole of the halogenalkane.

One mole of the ammonia acts as a nucleophile and attacks the δ+ carbon atom in the halogenalkane while the other mole of ammonia acts as a base and abstracts a proton (H+) from the quaternary ammonium salt. The final product in this case is methylamine.


Mechanism to show how ammonia can act as a nucleophile and as a base in its reactions with halogenalkanes or alkyl halides.

Explanation of mechanism:


Self-check: Quick review of main points in the Mechanism covered so far

For each step, decide what is actually happening chemically. No arrows, no drawings — just logic.

Step 1: The hydroxide ion approaches the haloalkane and forms a new bond to carbon.
Step 2: The C–Br bond breaks and bromide leaves.
Step 3: A second ammonia molecule removes a hydrogen ion from the ammonium intermediate.
Step 4: Changing from aqueous to ethanolic hydroxide gives a different product.

On we go...........

However this is not the end of the story for this reaction. If you follow the mechanism closely you can clearly see that the ammonia simply swaps a hydrogen atom for a methyl group (-CH3) or if a different halogenalkane was used, for example bromoethane then an ethyl group (-C2H5) would replace a hydrogen atom on the ammonia to form ethylamine.

The problem is the product of the reaction; the primary amine is a stronger base and a better nucleophile than ammonia. So as the reaction proceeds its concentration will increase while the concentration of the ammonia will be decreasing and so the methylamine will take over from ammonia in the reaction mechanism. This will mean that one of the hydrogen atoms on the primary amine will be replaced by the methyl alkyl group to form a secondary amine, this is outlined below:


Mechanism for the reaction of a halogenalkane and an amine, nucleophilic substitution.

I am sure you can see where this going! The product of the reaction above, the dimethylamine is a better nucleophile than the primary amine; methylamine. This means that as the concentration of the secondary amine; dimethylamine increases it will take over from the methylamine to form the tertiary amine trimethylamine. Even here the reaction will not stop! The trimethylamine will continue to react with the bromomethane and form the quaternary ammonium salt where all the hydrogen atoms from the original ammonia molecule have been replaced by -methyl groups.

This ultimately leads to a mixture of products; primary, secondary, tertiary amines as well as a quaternary ammonium salt. This mixture of products will ultimately reduce the usefulness of this particular reaction. We can of course try to stop the reaction at the first step and only produce the methylamine, to do this we simply try to block out the methylamine by using a large excess of ammonia. This will work to a certain extend by sheer weight of numbers the ammonia molecules will simply block the methylamine and limit the reaction to produce only the primary amine methylamine.


Self-check: What factors decide on the reaction outcome?

In each case below, decide what factor is most responsible for the reaction outcome.

A haloalkane reacts with NaOH to give an alcohol rather than an alkene.
The carbon chain becomes longer when a haloalkane reacts under reflux.
Excess ammonia is used to increase the yield of a primary amine.
Hydroxide ions sometimes cause elimination instead of substitution.


Summary table: nucleophilic substitution reactions of haloalkanes

Reaction 🧪 Nucleophile / reagent 🔵 Key conditions 🔥🌊 Main product ✅ Big exam point 🎯
Hydrolysis to alcohol OH- (from NaOH / KOH) Warm aqueous + time (often reflux) Alcohol (R–OH) 🍶 OH- acts as a nucleophile in aqueous conditions
Elimination (competing reaction) OH- (base) Hot ethanolic NaOH / KOH Alkene + H2O 🔥 Same reagent, different outcome: base vs nucleophile
Making a nitrile (chain extension) CN- (KCN / NaCN) Warm alcoholic/aqueous, reflux 🔄 Nitrile (R–C≡N) 🧬 Adds one carbon to the chain (useful synthesis step)
Making an amine (aminolysis) NH3 (ammonia) Sealed tube / pressure, heat 🔒 Primary amine (R–NH2) 🧠 Often gives a mixture unless excess ammonia is used
Why reflux is used Heat for longer without losing volatile reactants 🔄 Improves yield / completion ✅ Haloalkanes are poorly soluble in water, so reactions can be slow without reflux
Nucleophilicity factors Charge, electronegativity, solvent, steric hindrance ⚡ Faster or slower attack ⏱️ Polar protic solvents can “wrap up” anions; aprotic solvents often increase nucleophilicity

Self-check: One minute quick quiz

Quick check before you leave the page. Answer the questions, then hit “Check answers”.

1) Which reagent and conditions most strongly favour forming an alcohol from a haloalkane?
2) Which nucleophile extends the carbon chain by one carbon atom?
3) Why is excess ammonia used when making a primary amine from a haloalkane?
4) Which statement about reflux is correct?

The exam-trap: What not to do or say in the exam

These are the mistakes that silently steal marks. Pick an option, then check the feedback.

Trap 1: What does delta plus carbon actually mean in a C–X bond?
Trap 2: Which statement is always true about multiple substitution/elimination outcomes?
Trap 3: What is the key organic product when a haloalkane reacts with CN- (under the usual conditions)?
Trap 4: Why does reacting a haloalkane with ammonia often give a mixture of amines?
Trap 5: What is the best reason reflux is used for some of these reactions?

Key Points

🧠 1-minute self-check

Before you move on, can you confidently say yes to these?

If you hesitated on any of these, scroll back and fix it now. That’s how you pick up easy exam marks.



Practice questions

Check your understanding - Questions on Nucleophilic substitution reactions


Next