In this paper, we propose a peak extraction algorithm based on generalized cross-correlation method in chromatic confocal microscopy. In this approach, a high level of localization precision is achieved by utilizing the generalized cross-correlation function between the chromatic confocal signal and the template signal. Compared to the algorithms proposed in recent years, the proposed algorithm is found to have lower localization bias and standard deviation.Both the simulation and the experimental results confirm the significant accuracy advantage of the proposed algorithm.