Trace impurity elements in petroleum raw materials will cause the corrosion of equipment and quality decline of products in refining process. Otherwise, additive elements in products are the key to improve product performance. Therefore, continuous monitoring and analysis of elemental composition is essential throughout petroleum refining. As a result of a remarkable progress in both hardware and software, the X-ray fluorescence (XRF) technology has become one of the most promising universal testing technologies for low carbon and environmental protection due to its fast, convenient, and nondestructive characteristics, as well as covering multiple elements. The main progress of XRF technology in recent years was introduced, the application characteristics and problems of XRF in diverse fields such as crude oil, gasoline, diesel oil, lubricating oil, petroleum coke and catalyst were comprehensively reviewed, and the changing trends of industry standard methods and standard formulation were further summarized. Not only a comprehensive overview of the challenges associated with XRF application in the petrochemical industry was provided, but also future trend for its implementation was predicted. © 2024 Editorial Office of Acta Petrolei Sinica. All rights reserved.