Light element alloying in iron is required to explain density deficit and seismic wave velocities in Earth’s core. However, the light element composition of the Earth’s core seems hard to constrain as nearly all light element alloying would reduce the density and sound velocity (elastic moduli). The alloying light elements include oxidizing elements like oxygen and sulfur and reducing elements like hydrogen and carbon, yet their chemical effects in the alloy system are less discussed. Moreover, Fe-X-ray Absorption Near Edge Structure (Fe-XANES) fingerprints have been studied for silicate materials with ferrous and ferric ions, while not many X-ray absorption spectroscopy (XAS) studies have focused on iron alloys, especially at high pressures. To investigate the bonding nature of iron alloys in planetary interiors, we presented X-ray absorption spectroscopy of iron–nitrogen and iron–carbon alloys at high pressures up to 50 GPa. Together with existing literature on iron–carbon, –hydrogen alloys, we analyzed their edge positions and found no significant difference in the degree of oxidation among these alloys. Pressure effects on edge positions were also found negligible. Our theoretical simulation of the valence state of iron, alloyed with S, C, O, N, and P also showed nearly unchanged behavior under pressures up to 300 GPa. This finding indicates that the high pressure bonding of iron alloyed with light elements closely resembles bonding at the ambient conditions. We suggest that the chemical properties of light elements constrain which ones can coexist within iron alloys.