The influence of thermal oxidation on the composition of silicon nitride films in SiO2/Si3N4/SiO2 stacks for advanced nonvolatile memories is reported. X-ray photoelectron spectroscopy and time-of-flight secondary ion mass spectrometry analyses lead to the conclusion that wet thermal (pyrogenic) oxidation of silicon nitride enhances the incorporation of oxygen into the silicon nitride layer and creates a silicon oxynitride layer. In the oxynitride layer formed by wet oxidation, O is mostly bonded to N, whereas in the native oxynitride at the silicon nitride surface, O is preferentially bonded to Si. Dry oxidation (1200 °C) results in an even higher amount of oxygen incorporation into the silicon nitride layer as compared with the pyrogenic process. After both pyrogenic and dry oxidation, hydrogen concentration decreases in the bulk of the silicon nitride layer. Following wet oxidation, hydrogen was found to accumulate at the surface layers of the grown oxynitride film. Oxygen penetration into the nitride layer was found to be higher in thinner nitride layers. The peculiarities of hydrogen distribution were not affected by the thickness of the nitride layer.