As a typical fossil fuel, coal is a major contributor to nitrogen oxide (NOx) pollution. The detailed mechanism of NOx generation from coal pyrolysis need to be clarified. Within this research, we used density functional theory (DFT) to investigate the formation mechanism of HCN as a NOx precursor during pyrolysis of pyrrole in the presence of hydrogen (H) radicals. Firstly, three different reaction positions for hydrogen radical attacking were compared. It was identified that hydrogen radical initially reacts with pyrrole at the location adjacent to N through a single elementary reaction step with an activation energy of 77.12 kJ/mol. Additionally, to examine the role of hydrogen radical in the pyrrole pyrolysis to form HCN, 12 subsequent reaction pathways were theoretically investigated. It was found that one of the pathway (Pathway a-4) involving hydrogen transfer followed by carbon-carbon cleavage processes is the route with the lowest energy barrier of all of the mechanisms reported, thus it plays an important role in the formation of HCN from the pyrrolic components of coal. These results further indicated that the hydrogen radicals significantly reduce the energy barrier of the pyrrole pyrolysis.