NiO thin film was prepared by the sol-gel technique and analyzed by thermogravimetry, X-ray diffractometry and X-ray photoelectron spectroscopy. The electrochromic characteristics were studied by ultraviolet spectroscopy. The experiment results showed that the sol-gel process with dip-coating deposition is an effective way to make NiO thin films. The thin film composition depends strongly on the heat treatment temperature, and the electrochromism efficiency of the films prepared at 450° C is optimum.