In chromatography substances are separated by partition between a stationary phase and a mobile phase. The analyte is dissolved in the mobile phase, and passes over the stationary phase. Separation occurs because of differing affinities of the analytes for the stationary phase. A distribution constant, K can be defined as
where a and a are the equilibrium activities in the stationary and mobile phases respectively. It can be shown that the rate of migration, , is related to the distribution constant by
f is a factor which depends on the volumes of the two phases. Thus, the higher the affinity of the solute for the stationary phase, the slower the migration rate.
There is a wide variety of chromatographic techniques, depending on the nature of the stationary and mobile phases. When the stationary phase is solid, the analyte may form a complex with it. A water softener functions by selective complexation with a sulfonate ion exchange resin. Sodium ions form relatively weak complexes with the resin. When hard water is passed through the resin, the divalent ions of magnesium and calcium displace the sodium ions and are retained on the resin, R. 
: RNa + M  RM + Na
The water coming out of the column is relatively rich in sodium ions and poor in calcium and magnesium which are retained on the column. The column is regenerated by passing a strong solution of sodium chloride through it, so that the resin–sodium complex is again formed on the column. Ion-exchange chromatography utilizes a resin such as chelex 100 in which iminodiacetate residues, attached to a polymer backbone, form chelate complexes of differing strengths with different metal ions, allowing the ions such as Cu and Ni to be separated chromatographically.
Another example of complex formation is in chiral chromatography in which is used to separate enantiomers from each other. The stationary phase is itself chiral and forms complexes selectively with the enantiomers. In other types of chromatography with a solid stationary phase, such as thin-layer chromatography the analyte is selectively adsorbed onto the solid.
In gas–liquid chromatography (GLC) the stationary phase is a liquid such as polydimethylsiloxane, coated on a glass tube. Separation is achieved because the various components in the gas have different solubility in the stationary phase. GLC can be used to separate literally hundreds of components in a gas mixture such as cigarette smoke or essential oils, such as lavender oil.