Calculations have been made for the configurations of single-walled carbon nanotubes containing substitutional nitrogen impurity atoms with ab initio density functional theory.It has been found that N-doped zigzag single-walled carbon nanotubes are more stable than N-doped armchair carbon nanotubes.When more nitrogen atoms are incorporated into single-walled carbon nanotubes,the change of the structure along the tube longitude is greater than that along the tube axis.And we also have studied the bond structures for N-doped singlewalled carbon nanotubes in detail.