We propose Mg doping in zinc oxide (ZnO) films for realizing wider optical bandgap in highly c-axis oriented Zn1−xMgxO (0 ≤ x ≤ 0.3) thin films. A remarkable enhancement of 25% in the bandgap by 30% Mg doping was achieved. The bandgap was tuned between 3.25 eV (ZnO) and 4.06 eV (Zn0.7Mg0.3O), which was further confirmed by density functional theory based wien2k simulation employing a combined generalized gradient approximation with scissor corrections. The change of stress and crystallite size in these films were found to be the causes for the observed blueshift in the bandgap.