Abstract Membrane inlet mass spectrometry was used to measure O 2 and CO 2 as depth profiles in stab cultures of 0.1% agar Man Rogosa Sharpe medium inoculated with Lactobacillus paracasei CI3. Diffusion of CO 2 from the central column of growth into the medium was observed to show lower concentrations where bacteria were absent. CO 2 profiles developed in a manner similar to those in Cheddar cheese and O 2 was undetectable at similar depths. Gases were analysed in Cheddar cheese over a maturation period of 200 d. O 2 was detectable to depths of 13, 6 and 2.5 mm on days 2, 9 and 15, respectively, but then became undetectable at depths of 2.5–3 mm. CO 2 concentrations measured within the cheese increased 10-fold from day 2 to day 200 to reach a value of around 15 mM. The progress of measured CO 2 concentration over time at a given depth in cheese shows a hyperbolic type increase. Coefficient of regression values increase with depth to a maximum value of R 2=0.93. In both systems, reductions and increases in CO 2 were due to the absence or presence of bacterial growth, respectively. Confocal scanning laser and scanning electron microscopy was used to show spatial heterogeneity of microcolonies within the cheese ecosystem. This information can potentially be used as a non-sensory evaluation of cheese maturity status. Measurement of gases in a cheese ecosystem provides the first description of mass spectrometry being used to monitor the processes of microbial gaseous exchange with respect to O 2 and CO 2 in a cheese ecosystem.