Recently synthesized NdFe 12 N has excellent magnetic properties, while it is thermodynamically unstable. Using first-principles method, we study the effect of substitutional 3d transition metal elements to the mother compound NdFe 12 . We find that Co has positive effect on the stability of the ThMn 12 structure. In contrast with Ti substitution, Co substitution does not reduce the magnetization significantly. The crystal field parameter r 2 A 0 2 is nearly unchanged by Co substitution, and nitrogenation to NdFe 11 Co greatly enhances r 2 A 0 2 . This suggests that Co is a good candidate as a substitutional element for NdFe 12 N.