MgxZn1−xO has attracted more attention due to its tunable direct band gap, which can make it tune optical absorption from near to the deep ultraviolet range. The synthesis temperature has important influence on the regulation of bandgap. So, we studied the effects of synthetic temperature on properties in this work. Mg0.3Zn0.7O thin films were grown on quartz substrates by sol–gel method from 700 to 1000 °C. The effects of substrate temperatures on the structure and optical properties were investigated. The X-ray diffraction patterns showed that all the alloy films grew along (100), (101), (002) orientation, and belonged to a hexagonal wurtzite structure. With increase of the growth temperature, the diffraction intensity of the (002) peaks increase and the film along c-axis oriented growth was formed at 900 °C. The optical band gap enlarged gradually from 3.4628 to 3.5014 eV with the increase of the growth temperature and the film has the lowest resistivity of 5.248 × 107 Ω cm at 900 °C. The photo-electric properties of the film calcinated at 900 °C were studied. A maximum photocurrent is 1.54 µA at 20 V bias and photo-responsivity peaking at 330 nm is 1.66 A/W at 30 V bias, respectively.