Feature selection aims to select crucial features to improve classification accuracy in machine learning and data mining. In this paper, a new binary grasshopper optimization algorithm using time-varying Gaussian transfer functions (BGOA-TVG) is proposed for feature selection. Compared with the traditional S-shaped and V-shaped transfer functions, the proposed Gaussian time-varying transfer functions have the characteristics of a fast convergence speed and a strong global search capability to convert a continuous search space to a binary one. The BGOA-TVG is tested and compared to S-shaped and V-shaped binary grasshopper optimization algorithms and five state-of-the-art swarm intelligence algorithms for feature selection. The experimental results show that the BGOA-TVG has better performance in UCI, DEAP, and EPILEPSY datasets for feature selection.