The nitrogen-doped TiO2 thin films were prepared by mid-frequency alternative reactive magnetron sputtering technique. The N concentration of the nitrogen-doped TiO2 thin films was analyzed by XPS. And the absorption spectra of the films in ultraviolet and visible region were also investigated. The results show that the mid-frequency alternative reactive magnetron sputtering technique is a convenient method for growing TiO2-xNx. Annealing the nitrogen-doped TiO2 thin film in nitrogen atmosphere under 380°C is helpful for increase the concentration of nitrogen in the film, but the ratio of N2 in reactive gas is mainly influence the concentration of nitrogen in the Ti-N bond in the TiO2 film. The increase of the thickness of nitrogen-doped TiO2 films will enhance the absorbability of the film in the ultraviolet and visible region. The wavelength of the absorption edge of TiO2-xNx film with 1.5% nitrogen shift to 441nm from 387nm, which is the absorption edge for undoped TiO2 films.