Dual-wavelength digital holography is commonly used to measure samples with large height variations. However, the use of two wavelengths introduces chromatic aberration and reduces measurement accuracy. We propose an autofocusing achromatic method in dual-wavelength digital holography by synthetic phase gradient (SPG) minimization. This method performs numerical diffraction propagation on the complex amplitude of each wavelength, calculates the gradient of the synthetic phase obtained by subtracting the two phases at different positions, and determines the focal plane by locating the minimum SPG value to achieve chromatic aberration correction. Compared to traditional clarity-based refocusing methods, the approach is independent of amplitude-related factors by using SPG as a novel refocusing evaluation criterion. Therefore, our method exhibits higher sensitivity and is more universally applicable to reflective samples with intensity and phase mixed modulation. The effectiveness of the SPG is verified through simulation, and the measurement results of chips show that the proposed method could effectively eliminate chromatic aberration and significantly improve the accuracy of dual-wavelength measurement.