The present study aims to explore the spatial and temporal changes and drivers of carbon emission patterns in China, with the aim of encouraging county-level carbon reduction policies in pursuit of sustainable development. To this end, we have studied the spatial disparities, spatio-temporal patterns, and evolution characteristics of carbon emissions using county-level carbon emissions data from China between 2002 and 2017. Additionally, we have comprehensively considered the dynamic impacts of both county-level and city-level environmental factors on carbon emissions based on an optimized hierarchical random forest model. The results show that the carbon emissions of China’s counties have generally followed an upward trend before stabilizing. Notable characteristics include elevated carbon emissions in the northern regions and reduced carbon emissions in the southern areas. Additionally, there are higher carbon emissions in the eastern regions compared to lower emissions in the western and inland areas, with discernible local clustering patterns. These findings underscore the importance of tailoring the government’s emission reduction strategy to address the phased variations in carbon emissions across different districts and counties. It is essential to emphasize the key role of major urban agglomerations and metropolitan areas in carbon emission reduction, while also addressing potential emission sources in the resource-rich, yet technologically disadvantaged, northwest region. Furthermore, improving energy efficiency through technological innovation should be the primary means of carbon emission reduction at the county level.