A method for compensation of the index increment yielded by Li out-diffusion during Ti diffusion for the LiNbO3 waveguide formation is presented. Mg diffusion decreases the extraordinary refractive index, and its diffusion rate is far faster than that of Ti diffusion. An appropriate Mg diffusion condition is determined for eliminating the Li out-diffusion influence. Excellent optical confinement in the Ti-diffused LiNbO3 Y-cut strip waveguide is demonstrated with Mg diffusion.