We have performed a first-principles study to evaluate the electronic and optical properties of wurtzite Zn1-xCdxO up to x=0.25. We have employed the Perdew–Burke–Ernzerhof form of the generalized gradient approximation within the framework of density functional theory. Calculations have been carried out in different configurations. With increasing Cd concentrations, the band gap of Zn1-xCdxO is decreased due to the increase of s states in the conduction band. The results of the imaginary part of the dielectric function ε2(ω) indicate that the optical transition between O 2p states in the highest valence band and Zn 4s states in the lowest conduction band has shifted to the low energy range as the Cd concentrations increase. Besides, the optical band gap decreases from 3.2 to 2.84 eV with increasing Cd concentrations from 0 to 0.25. Meanwhile, the bowing parameter b, which has been obtained by fitting the results of the optical band gap, is about 1.21 eV. The optical constants of pure ZnO and Zn0.75Cd0.25O, such as optical conductivity, loss function, refractive index, and reflectivity, are discussed.