Gas molecules are known to interact with two-dimensional (2D) materials through surface adsorption where the adsorption-induced charge transfer governs the chemir-esistive sensing of various gases. Recently, titanium carbide (Ti3C2Tx) MXene emerged as a promising sensing channel showing the highest sensitivity among 2D materials and unique gas selectivity. However, unlike conventional 2D materials, MXenes show metallic conductivity and contain interlayer water, implying that gas molecules will likely interact in a more complex way than the typical charge transfer model. Therefore, it is important to understand the role of all factors that may influence gas sensing. Here, we studied the gas-induced interlayer swelling of Ti3C2Tx MXene thin films and its influence on gas sensing performance. In situ X-ray diffraction was employed to simultaneously measure dynamic swelling behavior where Ti3C2Tx MXene films displayed selective swelling toward ethanol vapor over CO2 gas. Results show that the controlling sodium ion concentration in the interlayers is highly important in tuning the swelling behavior and gas sensing performance. The degree of swelling matched well with the gas response intensity, and the highest gas selectivity toward ethanol vapor was achieved for Ti3C2Tx sensing channels treated with 0.3 mM NaOH, which also displayed the largest amount of swelling. Our results demonstrate that controlling the interlayer transport of Ti3C2Tx MXene is essential for enhancing the selective sensing of gas molecules.