A two-color scheme of heterodyne laser interferometer is devised for distance measurements with the capability of real-time compensation of the refractive index of the ambient air. A fundamental wavelength of 1555 nm and its second harmonic wavelength of 777.5 nm are generated, with stabilization to the frequency comb of a femtosecond laser, to provide fractional stability of the order of 3.0 × 10(-12) at 1 s averaging. Achieved uncertainty is of the order of 10(-8) in measuring distances of 2.5 m without sensing the refractive index of air in adverse environmental conditions.