The compound specific hydrogen and carbon stable isotope ratios of alkanes in natural gases from the Xujiahe and Jurassic formations in the western Sichuan Basin were investigated to distinguish between coal-derived and oil-associated gases. All gases were determined to be coal-derived and sourced from the Xujiahe Formation. Thermal maturities of the source rocks are expected to vary from 0.8–1.8% vitrinite reflectance (%R o ) according to the empirical relationship between the measured δ 13 C CH4 values and % R o , which is within the scope of the maturities of source rocks (0.7–2.1%). In particular, C 1–3 alkanes of primary coal-derived gases which have not undergone any secondary alteration become more enriched in deuterium with increasing molecular mass and the δD CH4 values increase with increasing thermal maturity of source rocks. In the Sichuan Basin, δD values of coal-derived gases sourced from terrigenous source rocks of the Xujiahe Formation are more negative than those of oil-associated gases sourced from marine organic matter of the Sinian, Permian and Triassic formations.