Lunar glass can provide critical information on the genesis of lunar rocks and the evolution of the Moon's interior. Several minor and trace elements in lunar glass, such as Na, K, P, S, Cr, and Ni, can be measured by electron probe microanalysis (EPMA) and are informative for understanding glass type, impact volatilization, and magmatic evolution processes. However, the analytical accuracy and precision of these trace-level elements in glass can be impeded by beam sensitivity, peak shift of X-ray and secondary fluorescence effects. Using EPMA, we constructed an optimized analytical method with high accuracy and precision to analyze trace elements simultaneously with major elements in lunar glass. The method was developed using the CAMECA SXFive EPMA at the Institute of Geology and Geophysics, Chinese Academy of Sciences (IGGCAS). The optimal analytical conditions for Na, K, P, S, Cr, and Ni in lunar glass were as follows: 20 kV accelerating voltage, 100 nA beam current, 10 μm beam diameter, linear background mode, using large-area analytical crystals and aggregate counting strategy and a 10-min total counting time. Replicate analyses on basalt and komatiite glass standards show that the analytical results are consistent with the reference values. Variations in the levels of the analyzed trace elements fall within ± 10%. The detection limits (3σ) for Na, K, P, S, Cr, and Ni can be lowered to 17-96 ppm. Our method can prohibit sample damage of lunar glass even after a 10-min analysis time. Therefore, this optimized method can provide precise trace and major element analysis of lunar glass and help to trace its origin.