We present a fitting calculation of energy-loss function for 26 bulk materials, including 18 pure elements (Ag, Al, Au, C, Co, Cs, Cu, Er, Fe, Ge, Mg, Mo, Nb, Ni, Pd, Pt, Si, Te) and 8 compounds (AgCl, Al2O3, AlAs, CdS, SiO2, ZnS, ZnSe, ZnTe) for application to surface electron spectroscopy analysis. The experimental energy-loss function, which is derived from measured optical data, is fitted into a finite sum of formula based on the Drude-Lindhard dielectric model. By checking the oscillator strength-sum and perfectscreening-sum rules, we have validated the high accuracy of the fitting results. Furthermore, based on the fitted parameters, the simulated reflection electron energy-loss spectroscopy (REELS) spectrum shows a good agreement with experiment. The calculated fitting parameters of energy loss function are stored in an open and online database at http://micro.ustc.edu.cn/ELF/ELF.html.