Answer: This is so because of greater electron-electron repulsion in oxygen atom.
Step-by-step explanation:
Ionization energy is defined as the energy required to remove an electron from the outermost shell of an isolated gaseous atom. It is represented as


Nitrogen is the 7th element of the periodic table having electronic configuration of
. This is a half-filled electronic configuration.
Oxygen is the 8th element of the periodic table having electronic configuration of
. This is a partial filled electronic configuration.
The nuclear charge of oxygen is more, because more number of electrons are getting attracted to the nucleus. But, removal of electron is easy in oxygen because of greater electron-electron repulsion.
Due to this, the removal of extra electron from oxygen is easy than the removal of electron form stable configuration of nitrogen.
Hence, the ionization energy of nitrogen is higher than the ionization energy of oxygen.