Metal/nitrogen-doped carbons (MÀ NÀ C) are promising candidates as oxygen electrocatalysts due to their low cost, tunable catalytic activity and selectivity, and well-dispersed morphologies. To improve the electrocatalytic performance of such systems, it is critical to gain a detailed understanding of their structure and properties through advanced characterization. In situ X-ray absorption spectroscopy (XAS) serves as a powerful tool to probe both the active sites and structural evolution of catalytic materials under reaction conditions. In this review, we firstly provide an overview of the fundamental concepts of XAS and then comprehensively review the setup and application of in situ XAS, introducing electrochemical XAS cells, experimental methods, as well as primary functions on catalytic applications. The active sites and the structural evolution of MÀ NÀ C catalysts caused by the interplay with electric fields, electrolytes and reactants/intermediates during the oxygen evolution reaction and the oxygen reduction reaction are subsequently discussed in detail. Finally, major challenges and future opportunities in this exciting field are highlighted.