Coal dependence and inefficient decentralized heating have significantly increased China’s energy consumption for winter heating, increasing air pollution and exacerbating the greenhouse effect. In 2017, China implemented the Pilot Policy on Clean Winter Heating in Northern China, aiming to achieve high central heating coverage and cleaner energy consumption. Studying the effects of this policy can help promote its implementation and serve as a reference for effective adjustment of the contents in the future. However, few studies have investigated this policy and its carbon reduction effects, and most focus on the provincial or city levels. Therefore, this paper considers the policy’s influence on air pollution and carbon emissions at the county level to provide a precise and comprehensive assessment of the policy effects. We use panel data from 1 290 counties in 15 provinces in Northern China from 2014 to 2021, applying a multiperiod difference-in-differences model to quantify the impact of the policy on carbon emissions and air quality in the pilot area. We then conduct a series of tests to demonstrate the robustness of the results and analyze the mechanisms of the policy effects from two perspectives, namely, central heating and natural gas use, through a mediating effect model. Finally, we examine the heterogeneity of policy effects between counties based on geographic location and per capita income levels of rural residents through a moderating effect model. The results reveal that the policy significantly reduces air pollution and carbon emissions in the pilot area by increasing the central heating area and natural gas use. Compared with the central and western regions in the north and areas with low-income rural residents, the policy effects in the eastern regions in the north and areas with high-income rural residents are more pronounced.