Electrospray ionisation ion trap mass spectrometry (ESI-MSn) has been used to study the fragmentation patterns of nicotine and nine of its related compounds. From this study certain characteristic fragmentations are apparent with generally the pyrrolidine or piperidine ring being subject to chemical modifications. The structures of the product ions proposed for the ESI-MSn study have been supported by results from electrospray ionisation quadrupole time-of-flight mass spectrometry (ESI-QTOF-MS). Compounds with pyrrolidine and piperidine rings that possess an unsubstituted N atom have been shown to lose NH3 at the MS2 stage. Those compounds with N-methyl groups lose CH3NH2 at the MS2 stage. The loss of NH3 or CH3NH2 leaves the corresponding rings opened and this is followed by ring closure at the pyridine-2 carbon atom. Mono-N-oxides fragment in a similar way but the di-N-oxide can also fragment by cleavage of the bond between the pyridine and pyrrolidine rings. Cotinine also can undergo cleavage of this bond between the rings. This data therefore provides useful information on how substituents and the nature of the non-pyridine ring can affect the fragmentation patterns of nicotine and its related compounds. This information can be used in the characterisation of these compounds by liquid chromatography/ electrospray ionization mass spectrometry (LC/ESI-MS) which results in the separation of nicotine and its related compounds with limits of detection (LODs) ranging from 15 to 105 ng/mL. The use of LC/ESI-MS to study nicotine-containing samples resulted in the simultaneous and unambiguous identification of seven of the compounds discussed in this paper: cotinine identified at retention time 12.5 min (with its [M+H](+) ion at m/z 177), nornicotine 16.0 min (m/z 149), anatabine 18.0 min (m/z 161), myosmine 18.5 min (m/z 147), anabasine 20.4 min (m/z 163), nicotine 22.2 min (m/z 163), and nicotyrine 31.4 min (m/z 159). For quality control of nicotine replacement therapy products, these nicotine impurities can be readily identified and determined at levels up to 0.3% for single impurities and up to 1.0% for total impurities. Copyright (c) 2007 John Wiley & Sons.