The geometry optimization of the nitrogen-doped diamond has been carried out by the density functional theory (DFT) calculations. We model the defective diamond of substitutional and interstitial nitrogen atoms by using a simple-cubic supercell. Atoms in the supercell are relaxed by allowing them to move so that the atomic forces are less than 5.0 × 10-3 eV/Å. We calculate the formation energy for substitutional and interstitial sites. We find that the formation energy for the substitutional defect is10.89 eV. We check the convergence of the calculation with respect to the k×k×k - Monkhorst-Pack grids. We show that the energy difference between k = 4 and 6 is very small (7.0 meV). We also check the calculations by using a 216-sites supercell and find that the energy difference is 0.10 eV. Thus, the calculations of the formation energy converge well. As for the interstitial defect, we model some possible configurations and find that the smallest formation energy is 21.88 eV. Therefore, the most stable configuration of the nitrogen-doped diamond belongs to the substitutional site.