The thermal generation of hydrocarbon gases in sedimentary systems is generally thought to be an exclusively high-temperature process1, although previous work has indicated that significant generation may take place at burial temperatures as low as 65 °C (ref. 2). Here we present the carbon-isotope signatures of gases from the Western Canadian sedimentary basin. The isotope data show that low-temperature thermal generation of non-methane hydrocarbons occurs at temperatures lower than 62 °C and possibly as low as 20 °C. We can distinguish between gases of shallow3,4 and deep origin by using the carbon-isotope compositions of the non-methane components (ethane, propane and butane); the shallow gases have isotopic compositions consistent with a thermal origin, whereas the deep gases—although of abiogenic origin—bear isotopic signatures that have been biologically altered. These findings have allowed the development of a successful tool for detecting the source of leaking gases around oil wells in this basin, enabling cheaper and more effective remediation.