The pyrolysis/gasification experiments of Xuzhou bituminous coal (XZ) and Longyan anthracite (LY) were carried out in a tube furnace under Ar or CO 2 atmosphere, and the effect of CO2 on the evolution of NOx precursors, NH3 and HCN, was studied using a Fourier transform infrared (FTIR) spectrometer. Results show that CO2 influences NH3 and HCN evolution process in two main ways: one is blocking the contact of the N-sites and the H-radicals by absorbed on the coal matrix surface at low temperature, and the other is opening the N-sites from the coal matrix by gasification at high temperature. For both XZ and LY coals, CO2 atmosphere suppresses NH3 yield and enhances HCN yield due to the gasification effect compared with that in Ar atmosphere. But the impact is not the same. The HCN/NH3 ratio is elevated in CO 2 atmosphere compared with that in Ar atmosphere.