Carbon emissions have increasingly been the focus of all governments as countries throughout the world choose carbon neutrality as a national development strategy. China is committed to pursuing a path of sustainable, green, and low-carbon growth, with the aim of achieving its carbon peak by 2030 and carbon neutrality by 2060. The analysis of the spatiotemporal dynamics of CO2 emission has emerged as a significant research topic in light of the dual-carbon goal. In this research, we explore the spatiotemporal changes of CO2 emission at different scales based on nighttime light data. The Chinese Academy of Science’s Earth Luminous Dataset, CO2 emission data from Carbon Emission Accounts and Datasets, and basic national geographical data are used for analysis. A linear regression model between nighttime light data and CO2 emission is constructed. Thereafter, the global Moran’s I index of exploratory spatial data analysis is used to verify the spatial parameters of all provinces. The trend value method is utilized to analyze the changing trend of CO2 emission at multiscale levels, covering the Chinese mainland, three major economic regions, and six largest agglomerations from 2012 to 2019. Experimental results show a significant positive correlation between the CO2 emission and nighttime light data from 2012 to 2019. The nighttime light data could be used to effectively estimate the total CO2 emission at the provincial and municipal levels in China. The growth rate of CO2 emissions in China is stable and has decreased in 2015. Meanwhile, the changing of CO2 emission in the central region is not obvious, the eastern developed region declines, and the western region increases. Furthermore, the spatiotemporal dynamics of CO2 emission in different agglomerations vary. The results of these examinations indicated that China has made significant contributions in emission reduction. Our work provides a scientific basis for the different provinces and cities to develop feasible emission reduction policies.