Calcium-based compounds are major inorganic components in coal and also widely used as additives in thermal conversion of coal and, thus, have important effects on the decomposition of nitrogen-containing compounds to form NO x . In this work, the influence of Ca 2+ on the pyrolysis of pyrrole and benzopyrrole (indole) to form HCN, a precursor of NO x , was investigated via a density functional theory (DFT) calculation with B3LYP/6-31+G(d,p) basis set. The results suggest that Ca 2+ has strong interactions with pyrrole and indole by altering the original electron density distribution of the pyrrole ring and the configurations of pyrrole derivatives, respectively. Ca 2+ affects the energy barriers of the elementary pyrolytic reactions (i.e., internal hydrogen transfer, isomerization, and concerted decomposition) and particularly reduces the energy barriers of the ratedetermining steps for HCN formation. In comparison to alkali metal ion Na + , alkali earth metal ion Ca 2+ has a stronger influence on the pyrrole and indole pyrolysis to form HCN.