Dual wavelength digital holography is an effective technique for the measurement of object profile with the discontinuities especially for an object of thickness greater than single wavelength. However; phase information of the two reconstructed images obtained by two different wavelengths usually can’t match precisely. As a result, signal to noise ratio (SNR) of reconstructed image of the equivalent wavelength increases and the real phase information of object can’t be measured accurately. It is because in space multiplex system, the focal plane asymmetry is produced due to the discrepancy between the two wavelengths through the splitter and CCD front lens, which worsens the mismatching of the two phase information. In this paper, the method of refocusing two holograms with autofocusing algorithm based on the gradient square criterion is proposed. The matching error can be decreased easily since two real distances for the reconstruction of object information are obtained. Considering the advantages of autofocusing algorithm, the phase of sample can be measured quickly with accuracy. This method provides a basis for real-time reconstruction of dual wavelength digital holography in micro-structure measurement field. Finally, the off-axis Fresnel digital holography is implemented with Mach-Zehnder setup to verify the effectiveness of the proposed method and the three-dimensional morphology of phase grating is measured successfully.