Electrical conduction in undoped and indium-doped ZnO films in as-deposited, vacuum-annealed and oxygen-annealed states has been studied. The as-deposited and oxygen-annealed films contain a large density (≥ 1017 m−2) of trap states due to chemisorbed oxygen at the grain boundaries. The role of these trap states has been analyzed in terms of the grain boundary carrier trapping model. The vacuum-annealed films are free of chemisorbed oxygen, and the conduction in these films is controlled by scattering due to ionized impurities and grain boundary barriers. In the case of undoped ZnO films, intrinsic trap states at the grain boundaries also play a significant role. The optical behavior of all films in the UV and visible regions is dielectric-like and the optical bandgap shows a dependence on free carrier concentration that is controlled by a bandgap narrowing effect due to electron-electron and electron-impurity interactions as well as the Moss-Burstein effect of bandgap widening. In the IR region the optical behavior is metal-like due to free-electron effects and follows the Drude model.