Laser differential confocal microscopy (DCM) has advantages of high axial resolution and strong ability of focus identification. However, the imaging mechanism of point scanning needs long measurement time, in the process due to itself mechanical instability and the influence of environment vibration the axial drift of object position is inevitable, which will reduce lateral resolution of the DCM. To ensure the lateral resolution we propose an axial drift compensation method based on zero-tracking in this paper. The method takes advantage of the linear region of differential confocal axial response curve, gets axial drift by detecting the laser intensity; uses grating sensor to monitor the real-time axial drift of lifting stage and realizes closed-loop control; uses capacitive sensor of objective driver to measure its position. After getting the axial drift of object, the lifting stage and objective driver will be driven to compensate position according to the axial drift. This method is realized by using Visual Studio 2010, and the experiment demonstrates that the compensation precision of the proposed method can reach 6 nm. It is not only easy to implement, but also can compensate the axial drift actively and real-timely. Above all, this method improves the system stability of DCM effectively.