We studied the structural, electronic, and optical properties of the In2O3(ZnO)n system by a combination of high-resolution electron microscopy, image simulation, and density-functional theory calculation. We found that the In2O3(ZnO) n system has a polytypoid structure that consists of wurtzite InZnnOn+1 slabs separated by single In-O octahedral layers. These octahedral layers are inversion domain boundaries and satisfy the electronic octet rule. The InZnnOn+1 slabs contain another type of boundary that inverts the polarities again. This boundary prefers a zigzag modulated structure and also obeys the electronic octet rule. We also found that the red-shift in optical transitions for the In2O 3(ZnO)n system as compared to individual In 2O3 and ZnO systems is because the symmetry-forbidden band-edge transitions in In2O3 are overcome by the formation of superlattices, with ZnO contributions to the top of the valence band. We further found that increasing n results in an enhanced valence-band maximum in the ZnO region, while the conduction-band minimum becomes more localized on the InO2 layers, which introduces confinement to electron carriers. Such enhanced localization explains why Zn-rich compounds (higher n) exhibit lower conductivity.