Reducing the energy consumption of nodes and prolonging network lifetime is a key issue in wireless sensor networks (WSN) research field. Clustering is an effective method to solve this problem. However, the effectiveness of existing clustering algorithms is not satisfactory. Therefore, we propose a binary bat algorithm based clustering approach (BBACA) in this paper. Firstly, the clustering of WSN is abstracted into a combinatorial optimization problem which is solved by using binary bat algorithm (BBA) with excellent performance. Secondly, a novel binary artificial bat encoding scheme and a fitness function using multiple parameters are designed elaborately. Finally, the final clustering scheme of WSN is obtained through multiple iterations of BBA. Simulation results show that BBACA can significantly reduce the energy consumption of nodes, extend the lifetime of the network, and achieve an outstanding clustering effect compared with other clustering algorithms.