High resolution medium energy ion scattering was used to characterize the nitrogen distribution in ultrathin silicon oxynitrides with sub-nm-accuracy. We show that nitrogen does not incorporate into the subsurface region of the substrate after oxidation of Si(100) in NO. Core-level photoemission experiments show two bonding configurations of nitrogen near the interface. Oxynitridation in N2O results in a lower concentration and a broader distribution of nitrogen than in the NO case.