Formation energies of various intrinsic defects and defect complexes in ZnO have been calculated using a density-functional-theory-based pseudopotential all-electron method. The various defects considered are oxygen vacancy (VO), zinc vacancy (VZn), oxygen at an interstitial site (Oi), Zn at an interstitial site (Zni), Zn at VO (ZnO), O at VZn(OZn), and an antisite pair (combination of the preceding two defects). In addition, defect complexes like (VO+Zni) and Zn-vacancy clusters are studied. The Schokkty pair (VO+VZn) and Frenkel pairs [(VO+Oi) and (VZn+Zni)] are considered theoretically for the first time. Upon comparing the formation energies of these defects, we find that VO would be the dominant intrinsic defect under both Zn-rich and O-rich conditions and it is a deep double donor. Both ZnO and Zni are found to be shallow donors. The low formation energy of donor-type intrinsic defects could lead to difficulty in achieving p-type conductivity in ZnO. Defect complexes have charge transitions deep inside the band gap. The red, yellow, and green photoluminescence peaks of undoped samples can be assigned to some of the defect complexes considered. It is believed that the red luminescence originates from an electronic transition in VO, but we find that it can originate from the antisite ZnO defect. Charge density and electron-localization function analyses have been used to understand the effect of these defects on the ZnO lattice. The electronic structure of ZnO with intrinsic defects has been studied using density-of-states and electronic band structure plots. The acceptor levels introduced by VZn are relatively localized, making it difficult to achieve p-type conductivity with sufficient hole mobility.