Alkylation is a chemical reaction that entails transfer of an alkyl group. The alkyl group may be transferred as an alkyl carbocation, a free radical, a carbanion, or a carbene (or their equivalents).  Alkylating agents are reagents for effecting alkylation. Alkyl groups can also be removed in a process known as dealkylation. Alkylating agents are often classified according to their nucleophilic or electrophilic character. In oil refining contexts, alkylation refers to a particular alkylation of isobutane with olefins. For upgrading of petroleum, alkylation produces a premium blending stock for gasoline. In medicine, alkylation of DNA is used in chemotherapy to damage the DNA of cancer cells. Alkylation is accomplished with the class of drugs called alkylating antineoplastic agents.
Nucleophilic alkylating agents deliver the equivalent of an alkyl anion (carbanion). The formal "alkyl anion" attacks an electrophile, forming a new covalent bond between the alkyl group and the electrophile. The counterion, which is a cation such as lithium, can be removed and washed away in the work-up. Examples include the use of organometallic compounds such as Grignard (organomagnesium), organolithium, organocopper, and organosodium reagents. These compounds typically can add to an electron-deficient carbon atom such as at a carbonyl group. Nucleophilic alkylating agents can displace halide substituents on a carbon atom through the SN2 mechanism. With a catalyst, they also alkylate alkyl and aryl halides, as exemplified by Suzuki couplings.
The SN2 mechanism is not available for aryl substituents, where the trajectory to attack the carbon atom would be inside the ring. Thus only reactions catalyzed by organometallic catalysts are possible.
C-alkylation is a process for the formation of carbon-carbon bonds. The largest example of this takes place in the alkylation units of petrochemical plants, which convert low-molecular-weight alkenes into high octane gasoline components. Electron-rich species such as phenols are also commonly alkylated to produce a variety of products; examples include linear alkylbenzenes used in the production of surfactants like LAS, or butylated phenols like BHT, which are used as antioxidants. This can be achieved using either acid catalysts like Amberlyst, or Lewis acids like aluminium. On a laboratory scale the Friedel–Crafts reaction uses alkyl halides, as these are often easier to handle than their corresponding alkenes, which tend to be gasses. The reaction is catalysed by aluminium trichloride. This approach is rarely used industrially as alkyl halides are more expensive than alkenes.
N-, P-, and S-alkylation are important processes for the formation of carbon-nitrogen, carbon-phosphorus, and carbon-sulfur bonds,
Amines are readily alkylated. The rate of alkylation follows the order tertiary amine < secondary amine < primary amine. Typical alkylating agents are alkyl halides. Industry often relies on green chemistry methods involving alkylation of amines with alcohols, the byproduct being water. Hydroamination is another green method for N-alkylation.
In the Menshutkin reaction, a tertiary amine is converted into a quaternary ammonium salt by reaction with an alkyl halide. Similar reactions occur when tertiary phosphines are treated with alkyl halides, the products being phosphonium salts.
Thiols are readily alkylated to give thioethers via the thiol-ene reaction. The reaction is typically conducted in the presence of a base or using the conjugate base of the thiol. Thioethers undergo alkylation to give sulfonium ions.
Alcohols alkylate to give ethers:
When the alkylating agent is an alkyl halide, the conversion is called the Williamson ether synthesis. Alcohols are also good alkylating agents in the presence of suitable acid catalysts. For example, most methyl amines are prepared by alkylation of ammonia with methanol. The alkylation of phenols is particularly straightforward since it is subject to fewer competing reactions.
More complex alkylation of a alcohols and phenols involve ethoxylation. Ethylene oxide is the alkylating group in this reaction.
In the process called oxidative addition, low-valent metals often react with alkylating agents to give metal alkyls. This reaction is one step in the Cativa process for the synthesis of acetic acid from methyl iodide. Many cross coupling reactions proceed via oxidative addition as well.
Electrophilic alkylating agents deliver the equivalent of an alkyl cation. Alkyl halides are typical alkylating agents. Trimethyloxonium tetrafluoroborate and triethyloxonium tetrafluoroborate are particularly strong electrophiles due to their overt positive charge and an inert leaving group (dimethyl or diethyl ether). Dimethyl sulfate is intermediate in electrophilicity.
Diazomethane is a popular methylating agent in the laboratory, but it is too hazardous (explosive gas with a high acute toxicity) 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.
Electrophilic, soluble alkylating agents are often toxic and carcinogenic, due to their tendency to alkylate DNA. This mechanism of toxicity is relevant to the function of anti-cancer drugs in the form of alkylating antineoplastic agents. Some chemical weapons such as mustard gas (sulfide of dichloroethyl) function as alkylating agents. Alkylated DNA either does not coil or uncoil properly, or cannot be processed by information-decoding enzymes.
Electrophilic alkylations use Lewis acids and Brønsted acids, sometimes both. Classically, Lewis acids, e.g., aluminium trichloride, are employed when the alkyl halide are used. Brønsted acids are used when alkylating with olefins. Typical catalysts are zeolites, i.e. solid acid catalysts, and sulfuric acid. Silicotungstic acid is used to manufacture ethyl acetate by the alkylation of acetic acid by ethylene:
Alkylation in biology causes DNA damage. It is the transfer of alkyl groups to the nitrogenous bases. It is caused by alkylating agents such as EMS (Ethyl Methyl Sulphonate). Bifunctional alkyl groups which have two alkyl groups in them cause cross linking in DNA. Alkylation damaged ring nitrogen bases are repaired via the Base Excision Repair (BER) pathway.
Several commodity chemicals are produced by alkylation. Included are several fundamental benzene-based feedstocks such as ethylbenzene (precursor to styrene), cumene (precursor to phenol and acetone), linear alkylbenzene sulfonates (for detergents).
In a conventional oil refinery, isobutane is alkylated with low-molecular-weight alkenes (primarily a mixture of propene and butene) in the presence of a Brønsted acid catalyst, which can include solid acids (zeolites). The catalyst protonates the alkenes (propene, butene) to produce carbocations, which alkylate isobutane. The product, called "alkylate", is composed of a mixture of high-octane, branched-chain paraffinic hydrocarbons (mostly isoheptane and isooctane). Alkylate is a premium gasoline blending stock because it has exceptional antiknock properties and is clean burning. Alkylate is also a key component of avgas. By combining fluid catalytic cracking, polymerization, and alkylation, refineries can obtain a gasoline yield of 70 percent. The widespread use of sulfuric acid and hydrofluoric acid in refineries poses significant environmental risks. Ionic liquids are used in place of the older generation of strong Bronsted acids.
Complementing alkylation reactions are the reverse, dealkylations. Prevalent are ether dealkylations.