Nickel and gold films are widely used for microsystems fabrication and packaging, as well as under bump metallization. In this paper, x-ray microanalysis was used to measure the thickness of Ni and Au films. Au and Ni films with varied thicknesses were deposited on silicon (Si) substrate by magnetron sputtering method. Incremental electron beam energy ranging from 4 keV to 30 keV was applied while other parameters were kept constant to determine the electron beam energy required to penetrate the metallic films. The effects of probe current at a fixed electron beam energy on the penetration depth were investigated too. With higher energy applied, the electron beam can penetrate deeper and more Si signal can be detected. The Ni and Au film thicknesses almost have linear relationship with the required penetration electron beam energy. The probe current has minimal effect on the specimen once it has reached the critical excitation probe current. For Ni and Au films with same thickness, higher energy or probe current is needed to penetrate the Au film to reach Si substrate due to the higher Au atomic weight.