The energetics of nitrogen-doped Ge2Sb2Te5 (GST225) with a hexagonal structure was investigated using first-principles calculations. Nitrogen was considered to be incorporated into the GST225 matrix as either N atoms (2.7 at. %) or N2 molecules (5.3 at. %) at four possible interstitial sites. The formation energies of nitrogen-doped GST225 were all positive for both the atomic state and molecular state nitrogen, implying that the incorporation of nitrogen is not a spontaneous reaction with respect to the N2 molecule. The formation energies of GST225 doped with N2 molecule are much lower than those of GST225 doped with nitrogen atom for all of the interstitial sites considered. The changes in the electron densities caused by the addition of nitrogen showed that atomic nitrogen forms bonds with neighboring constituent atoms of GST225 and prefers Ge as the first nearest atom. On the other hand, N2 stays almost still and remains in the molecular state at the interstitial sites. The calculation results support two different experimental reports on the state of nitrogen in GST225.