In atmospheric pressure chemical ionization mass spectrometry (APCI-MS), [M−3H+H2O]+ ions can deliver analyte-specific signals that enable direct analysis of volatile n-alkane mixtures. The underlying ionization mechanisms have been the subject of open debate, and in particular the role of water is insufficiently clarified to allow for reliable process analytics when the humidity level changes over time. This can be a problem, particularly in online monitoring, where analyte accumulation in the ion source can also occur. Here, we investigated the role of water during APCI-MS of volatile n-alkanes by changing the carrier gas for sample injection from a dry to a wetted state as well as by using 18O-labeled water. This allowed for a distinction between gaseous and surface-adsorbed water molecules. While adsorbed water seems to be responsible for the desired [M−3H+H2O]+ signals through surface reactions with the analyte molecules, gaseous water was found to promote the formation of CnH2n+1O+ of different (and analyte-independent) hydrocarbons, revealing a reaction with hydrocarbon species which accumulated in the ion source during continuous operation. At the same time, gaseous water competed with analyte molecules for ionization and thus suppressed the formation of alkyl (CnH2n+1+) and alkenyl (CnH2n−1+) ions. The results reveal a memory effect due to hydrocarbon adsorption, which may cause severe interpretation difficulties when the ionization chamber undergoes sudden humidity changes. The use of [M−3H+H2O]+ for n-alkane analysis in alkane/water mixtures can be facilitated by constantly maintaining high humidity and hence stabilizing the ionization conditions.Graphical abstract