The traditional ??-means clustering algorithm is only for numerical data. Therefore, a categorical data clustering method is proposed through extending the??-means algorithm to categorical data domain. In accordance with the information of data distribution correlated to each value of each categorical attribute, and at the same time combined with the vertical and horizontal distribution of the data to measure the difference between data object and the class, a new distance metric is defined. This method can find the intrinsic relationship between the different values of the same attribute, and can measure the difference between objects effectively. The performance of the proposed algorithm is verified on the dataset of the UCI. Experimental results show that the algorithm has better clustering results.