Al, N co-doped zinc oxide thin films were prepared using sol–gel assisted spin coating method with a range of nitrogen (N) doping (x=0, 1, 2). The deposited films were characterized through X-ray diffraction, UV–visible spectroscopy, photoluminescence spectroscopy and hall measurements to find structural, optical and electrical properties. The X-ray diffraction pattern was confirmed the existence of polycrystalline nature with wurtzite structure. The strong band emission and green emission peaks have been observed in Al, N co-doped films. The nitrogen undoped film demonstrated n-type conductivity and nitrogen doping brings p-type conductivity with maximum hole concentration of 8.111×10 16 cm −3 , carrier mobility of 9.965cm 2 /V.s for higher nitrogen doped film (x=2). The UV photo responsivity (7.17×10 –5 A/W) and gain (724.36×10 –5 ) of photo detector has been improved by a one order of magnitude in low nitrogen doping and decay time has been reduced drastically from 58.27s to 10.32s. These results demonstrated that the improved responsivity and decay time by 1at% of nitrogen doping.