The article shows the role of oxygen vacancies in the formation of luminescence bands of titanium and hafnium oxides, and also demonstrates the relationship between the intensity of luminescence bands and the conditions for the synthesis of films of these materials. It is concluded that photoluminescence is a very sensitive method for diagnosing the composition of oxides. Luminescence bands at 2.45 eV in titanium oxide and 2.91 eV in hafnium oxide make it possible to analyze the change in the film composition under various technological conditions of their production. Keywords: oxygen vacancies, titanium oxide, hafnium oxide, photoluminescence.