We applied density-functional theory (DFT) with the projector-augmented-wave method (PAW) to investigate systematically the energetics of C–N coupling reactions on Pt(111) and Ni(111)surfaces. Our approach includes several steps: the adsorption of reactants and products (CHx, NHy and CHxNHy, x = 0–3, y = 0–2), movement of molecular fragments on the surface, and then C–N coupling. According to our calculations, the energies (ignoring the conventional negative sign) of adsorption of CHx and NHy on Pt(111)/Ni(111) surfaces decrease in the order C > CH > CH2 > CH3 and N > NH > NH2, with values 7.41/6.91, 6.97/6.52, 4.58/4.39, 2.19/2.01 eV and 5.10/5.49, 4.12/4.79, 2.75/2.87 eV, respectively. Regarding the adsorption energies among CHxNHy, the adsorption energy of CNH2 species is the highest on the Pt(111) surface, whereas on the Ni(111) surface CH3N is the most stable. The C–N coupling barriers differ on the two metallic surfaces despite the structures of initial, transition and final states being similar. On the Pt(111) surface, the coupling reaction of CH2 + NH2 has the smallest barrier, whereas CH + NH2 is the most favorable on the Ni(111) surface. The detailed local density of states (LDOS) and electron-localization functions (ELF) were investigated to rationalize the calculated outcomes.