Quaternary ammonium cations, also known as quats, are positively charged polyatomic ions of the structure NR+
4, R being an alkyl group or an aryl group. Unlike the ammonium ion (NH+
4) and the primary, secondary, or tertiary ammonium cations, the quaternary ammonium cations are permanently charged, independent of the pH of their solution. Quaternary ammonium salts or quaternary ammonium compounds (called quaternary amines in oilfield parlance) are salts of quaternary ammonium cations. Polyquats are a variety of engineered polymer forms which provide multiple quat molecules within a larger molecule.
Quaternary ammonium compounds are prepared by the alkylation of tertiary amines with a halocarbon. In older literature this is often called a Menshutkin reaction, however modern chemists usually refer to it simply as quaternization. The reaction can be used to produce a compound with unequal alkyl chain lengths; for example when making cationic surfactants one of the alkyl groups on the amine is typically longer than the others. A typical synthesis is for benzalkonium chloride from a long-chain alkyldimethylamine and benzyl chloride:
Quaternary ammonium cations are unreactive toward even strong electrophiles, oxidants, and acids. They also are stable toward most nucleophiles. The latter is indicated by the stability of the hydroxide salts such as tetramethylammonium hydroxide and tetrabutylammonium hydroxide even at elevated temperatures. The halflife of Me4NOH in 6M NaOH at 160 °C is >61 h.
Because of their resilience, many unusual anions have been isolated as the quaternary ammonium salts. Examples include tetramethylammonium pentafluoroxenate, containing the highly reactive pentafluoroxenate (XeF−
5) ion. Permanganate can be solubilized in organic solvents, when deployed as its NBu+
With exceptionally strong bases, quat cations degrade. They undergo Sommelet–Hauser rearrangement and Stevens rearrangement, as well as dealkylation under harsh conditions or in presence of strong nucleophiles, like thiolates. Quaternary ammonium cations containing N–C–C–H units can also undergo the Hofmann elimination and Emde degradation.
Quaternary ammonium salts are used as disinfectants, surfactants, fabric softeners, and as antistatic agents (e.g. in shampoos). In liquid fabric softeners, the chloride salts are often used. In dryer anticling strips, the sulfate salts are often used. Older aluminium electrolytic capacitors and spermicidal jellies also contain quaternary ammonium salts. Quats are also used in contraception formulations, veterinary products, diagnostic testing, vaccine production, and nasal formulations. 
Quaternary ammonium compounds have also been shown to have antimicrobial activity. Certain quaternary ammonium compounds, especially those containing long alkyl chains, are used as antimicrobials and disinfectants. Examples are benzalkonium chloride, benzethonium chloride, methylbenzethonium chloride, cetalkonium chloride, cetylpyridinium chloride, cetrimonium, cetrimide, dofanium chloride, tetraethylammonium bromide, didecyldimethylammonium chloride and domiphen bromide. Also good against fungi, amoebas, and enveloped viruses, quaternary ammonium compounds are believed to act by disrupting the cell membrane or viral envelope. Quaternary ammonium compounds are lethal to a wide variety of organisms except endospores, Mycobacterium tuberculosis [disputed; source needed] and non-enveloped viruses.
Quaternary ammonium compounds are cationic detergents, as well as disinfectants, and as such can be used to remove organic material. They are very effective in combination with phenols. Quaternary ammonium compounds are deactivated by anionic detergents (including common soaps). Also, they work best in soft waters. Effective levels are at 200 ppm. They are effective at temperatures up to 100 °C (212 °F).
Quaternary ammonium salts are commonly used in the foodservice industry as sanitizing agents.
In organic chemistry, quaternary ammonium salts are employed as phase transfer catalysts (PTCs). Such catalysts accelerate reactions between reagents dissolved in immiscible solvents. The highly reactive reagent dichlorocarbene is generated via PTC by reaction of chloroform and aqueous sodium hydroxide.
In the 1950s, distearyldimethylammonium chloride (DHTDMAC), was introduced as a fabric softener. This compound was discontinued because the cation biodegrades too slowly. Contemporary fabric softeners are based on salts of quaternary ammonium cations where the fatty acid is linked to the quaternary center via ester linkages; these are commonly referred to as betaine-esters or ester-quats and are susceptible to degradation, e.g., by hydrolysis. Characteristically, the cations contain one or two long alkyl chains derived from fatty acids linked to an ethoxylated ammonium salt. Other cationic compounds can be derived from imidazolium, guanidinium, substituted amine salts, or quaternary alkoxy ammonium salts.
The antistatic qualities that make quaternary ammonium salts useful as fabric softeners also make them useful in hair conditioners and shampoos. The idea was pioneered by Henkel with a 1984 patent. Examples include cetrimonium chloride and behentrimonium chloride.
Cycocel (chlormequat chloride) reduces plant height by inhibiting the production of gibberellins, the primary plant hormones responsible for cell elongation. Therefore, their effects are primarily on stem, petiole and flower stalk tissues. Lesser effects are seen in reductions of leaf expansion, resulting in thicker leaves with darker green color.
Glycine betaine, found in osmolytes, stabilizes osmotic pressure in cells.
Choline is a precursor for the neurotransmitter acetylcholine. Choline is also a constituent of lecithin, which is present in many plants and animal organs. It is found in phospholipids. For example, phosphatidylcholines, a major component of biological membranes, are a member of the lecithin group of fatty substances in animal and plant tissues.
Carnitine participates in the beta-oxidation of fatty acids.
Quaternary ammonium compounds can display a range of health effects, amongst which are mild skin and respiratory irritation  up to severe caustic burns on skin and the gastrointestinal wall (depending on concentration), gastrointestinal symptoms (e.g., nausea and vomiting), coma, convulsions, hypotension and death.
They are thought to be the chemical group responsible for anaphylactic reactions that occur with use of neuromuscular blocking drugs during general anaesthesia in surgery. Quaternium-15 is the single most often found cause of allergic contact dermatitis of the hands (16.5% in 959 cases)
Quaternary ammonium-based disinfectants (Virex and Quatricide) were tentatively identified as the most probable cause of jumps in birth defects and fertility problems in caged lab mice. The quat ingredients in the disinfectants include alkyl dimethyl benzyl ammonium chloride (ADBAC) and didecyl dimethyl ammonium chloride (DDAC). A similar link was tentatively identified in nurses. The studies contradict earlier toxicology data reviewed by the U.S. Environmental Protection Agency (U.S. EPA) and the EU Commission.
The quantification of quaternary ammonium compounds in environmental and biological samples is problematic using conventional chromatography techniques because the compounds are highly soluble in water. While analyzing them by liquid chromatography coupled tandem mass spectrometry it has been found that they follow an exception rule. Under standard electrospray ionization (ESI) conditions, mono- and di-quaternary ammonium compounds form molecular ions with the formula of mq/zq rather than m + z/z.[clarification needed] Formation of mq/2 is observed for di-quaternary ammonium compounds (like diquat) as precursor ion and mq/1 as product ion due to the loss of one of the quaternary charge during CID. In di-quaternary ammonium compounds, this process can also result in the formation of fragment ions with higher mass as compared to their precursor ion. Hydrophilic interaction liquid chromatographic separation has been reported to demonstrate a successful separation of quaternary ammonium compounds for their quantification in ESI-MS/MS with higher precision.