# Halogenation

In chemistry, halogenation is a chemical reaction which introduces one or more halogens into a chemical compound. Halide-containing compounds are pervasive, making this type of transformation important, e.g. in the production of polymers, drugs. This kind of conversion is in fact so common that a comprehensive overview is challenging. This article mainly deals with halogenation using elemental halogens (F$_2$, Cl$_2$, Br$_2$, I$_2$). Halides are also commonly introduced using salts of the halides and halogen acids. Many specialized reagents exist for and introducing halogens into diverse substrates, e.g. thionyl chloride.

## Organic chemistry

Several pathways exist for the halogenation of organic compounds, including free radical halogenation, ketone halogenation, electrophilic halogenation, and halogen addition reaction. The nature of the substrate determines the pathway. The facility of halogenation is influenced by the halogen. Fluorine and chlorine are more electrophilic and are more aggressive halogenating agents. Bromine is a weaker halogenating agent than both fluorine and chlorine, while iodine is the least reactive of them all. The facility of dehydrohalogenation follows the reverse trend: iodine is most easily removed from organic compounds, and organofluorine compounds are highly stable.

### Free radical halogenation

Halogenation of saturated hydrocarbons is a substitution reaction. The reaction typically involves free radical pathways. The regiochemistry of the halogenation of alkanes is largely determined by the relative weakness of the C–H bonds. This trend is reflected by the faster reaction at tertiary and secondary positions.
Free radical chlorination is used for the industrial production of some solvents:
    CH$_4$ + Cl$_2$ → CH$_3$Cl + HCl
Naturally-occurring organobromine compounds are usually produced by free radical pathway catalyzed by the enzyme bromoperoxidase. The reaction requires bromide in combination with oxygen as an oxidant. The oceans are estimated to release 1–2 million tons of bromoform and 56,000 tons of bromomethane annually.
The iodoform reaction, which involves degradation of methyl ketones, proceeds by the free radical iodination.

### Fluorination

Because of its extreme reactivity, fluorine (F$_2$) represents a special category with respect to halogenation. Most organic compounds, saturated or otherwise, burn upon contact with F$_2$, ultimately yielding carbon tetrafluoride. By contrast, the heavier halogens are far less reactive toward saturated hydrocarbons.
Highly specialised conditions and apparatus are required for fluorinations with elemental fluorine. Commonly, fluorination reagents are employed instead of F$_2$. Such reagents include cobalt trifluoride, chlorine trifluoride, and iodine pentafluoride.
The method electrochemical fluorination is used commercially for the production of perfluorinated compounds. It generates small amounts of elemental fluorine in situ from hydrogen fluoride. The method avoids the hazards of handling fluorine gas. Many commercially important organic compounds are fluorinated using this technology.

### Addition of halogens to alkenes and alkynes

Unsaturated compounds, especially alkenes and alkynes, add halogens:
    R−CH=CH−R' + X$_2$ → R−CHX−CHX−R'
In oxychlorination, the combination of hydrogen chloride and oxygen serves as the equivalent of chlorine, as illustrated by this route to 1,2-dichloroethane:
    4 HCl + 2 CH$_2$=CH$_2$ + O$_2$ → 2 Cl−CH$_2$−CH$_2$−Cl + 2 H$_2$O
The addition of halogens to alkenes proceeds via intermediate halonium ions. In special cases, such intermediates have been isolated.
Bromination is more selective than chlorination because the reaction is less exothermic. Illustrative of the bromination of an alkene is the route to the anesthetic halothane from trichloroethylene:
Iodination and bromination can be effected by the addition of iodine and bromine to alkenes. The reaction, which conveniently proceeds with the discharge of the color of I$_2$ and Br$_2$, is the basis of the analytical method. The iodine number and bromine number are measures of the degree of unsaturation for fats and other organic compounds.

### Halogenation of aromatic compounds

Aromatic compounds are subject to electrophilic halogenation:
    R−C$_6$H$_5$ + X$_2$ → HX + R−C$_6$H$_4$−X
This kind of reaction typically works well for chlorine and bromine. Often a Lewis acidic catalyst is used, such as ferric chloride. Many detailed procedures are available. Because fluorine is so reactive, other methods, such as the Balz–Schiemann reaction, are used to prepare fluorinated aromatic compounds.

### Other halogenation methods

In the Hunsdiecker reaction, carboxylic acids are converted to organic halide, whose carbon chain is shortened by one carbon atom with respect to the carbon chain of the particular carboxylic acid. The carboxylic acid is first converted to its silver salt, which is then oxidized with halogen:
    R−COO$^−$Ag$^+$ + Br$_2$ → R−Br + CO$_2$ + Ag$^+$Br$^−$
    CH$_3$−COO$^−$Ag$^+$ + Br$_2$ → CH$_3$−Br + CO$_2$ + Ag$^+$Br$^−$
Many organometallic compounds react with halogens to give the organic halide:
    RM + X$_2$ → RX + MX
    CH$_3$CH$_2$CH$_2$CH$_2$Li + Cl$_2$ → CH$_3$CH$_2$CH$_2$CH$_2$Cl + LiCl

## Inorganic chemistry

All elements aside from argon, neon, and helium form fluorides by direct reaction with fluorine. Chlorine is slightly more selective, but still reacts with most metals and heavier nonmetals. Following the usual trend, bromine is less reactive and iodine least of all. Of the many reactions possible, illustrative is the formation of gold(III) chloride by the chlorination of gold. The chlorination of metals is usually not very important industrially since the chlorides are more easily made from the oxides and hydrogen chloride. Where chlorination of inorganic compounds is practiced on a relatively large scale is for the production of phosphorus trichloride and disulfur dichloride.