Clustering is one of the most fundamental techniques in data mining. Although various algorithms have been proposed to solve clustering problem, the main difficulty left is the determination of optimal number for clusters. There are many algorithms trying to automatically select reasonable cluster number, such as Silhouette, Gap-test, Akiake Information Criterion, and Bayes Information Criterion. However, these approaches are limited to the model-based nature of the process, which is not suitable for most unsupervised learning situations. In this paper, we propose an efficient automatic method to choose the optimal number of clusters based on finding density peaks, and our method has lower computional complexity cause we do not use various clustering results to optimize clustering number. The experimental results show it performs better than the existing methods in six famous data sets. Furthermore, based on automatically choosing the optimal number of clusters, an automatic cluster algorithm is proposed. Compared with other algorithms, our algorithm, without any manual parameter specified in advance, is more valid to discover the structure of data sets.