H2O–CO2 systematics of melt inclusions and obsidian pyroclasts has been used widely to explore the behaviour of fluids in magmatic systems under the assumption that a fluid–melt equilibrium is attained. However, fluid exsolution is a process involving the diffusive transfer of volatiles, and kinetic effects may control the composition of volatiles. In this study, single-step decompression experiments were carried out on H2O–CO2-bearing basaltic and rhyolitic melts to investigate the evolution of H2O–CO2 compositions during vesiculation. Microanalysis of the volatiles using Raman and infrared spectroscopy showed that CO2 content decreased towards bubbles, while H2O content was almost constant throughout the quenched glass samples. This resulted in higher CO2/H2O ratios than estimated from the equilibrium degassing, which is interpreted as a kinetic effect: the diffusivity of H2O is higher than that of CO2. A simple model for the diffusive degassing of ascending magma was developed to investigate the disequilibrium evolution of its H2O–CO2 content. CO2/H2O ratios were strongly dependent on the magma ascent velocity. The model was applied to melt inclusions with high CO2/H2O ratios from Etna and Stromboli volcanoes, and it was shown that the high ratios could not be explained by diffusive fractionation under a typical magma ascent velocity. Rather, these ratios are affected by other processes, such as CO2 fluxing.