The effect of annealing temperature on the microstructure, defects and optical properties of ZnO thin films are investigated using sol–gel based spin coating method for a range of annealing temperatures from 200 ∘C to 500 ∘C. The correlation among the microstructure, defects, impurity content and the optical band gap of films of thickness about 10–12 nm is elucidated. The particle size increases and the optical band gap reduces with the annealing temperature. At 200 ∘C, amorphous films were formed with particle size less than 10 nm with an optical band gap of about 3.41 eV. As the temperature increases the grain size increases and the defect, impurity content as well as the optical band gap reduces. This could be due to the reduction in the lattice strain. For an average grain size of about 35 nm and above, the band gap asymptotically approaches the theoretical value of ZnO (3.37 eV). The photoluminescence (PL) spectra show a systematic red-shift in the excitonic levels corresponding to the variation in the optical band-gap. The defect emission from Zn-vacancies is observed in the PL spectra and are further supported by the positron annihilation measurements.